From f4f9c71ead244949280b2372e9ec0c3ae4419137 Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Thu, 18 Jan 2024 17:00:34 +0100 Subject: [PATCH] TST: test for symbolic link in audeer.rmdir() --- tests/test_io.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_io.py b/tests/test_io.py index 072eb28..7f5472f 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1466,6 +1466,13 @@ def test_rmdir(tmpdir): audeer.rmdir("folder") assert not os.path.exists(path) os.chdir(current_path) + # Symlink + path = audeer.mkdir(tmpdir, "folder") + link = os.path.join(tmpdir, "link") + os.symlink(path, link) + audeer.rmdir(link) + assert not os.path.exists(link) + assert not os.path.exists(path) def test_touch(tmpdir):