From: Mike Gabriel Date: Mon, 30 Sep 2024 12:47:41 +0200 Subject: click_package/tests/test_user.py: Don't create XDG_CACHE_HOME if it already exists as symlink. Plus typo fix. Forwarded: https://gitlab.com/ubports/development/core/click/-/merge_requests/45 --- click_package/tests/test_user.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/click_package/tests/test_user.py b/click_package/tests/test_user.py index 4123138..419e693 100644 --- a/click_package/tests/test_user.py +++ b/click_package/tests/test_user.py @@ -673,12 +673,13 @@ class UserDataRemovalTestCase(TestCase): def test_remove_does_not_follow_if_xdg_dir_is_symlink(self): """ - Ensure that if the user-cach dir is a symlink that symlink is + Ensure that if the user-cache dir is a symlink that symlink is removed but that the symlink target is not touched """ fake_cache_dir = os.path.join( os.environ["XDG_CACHE_HOME"], self.appname) - os.makedirs(os.environ["XDG_CACHE_HOME"]) + if not os.path.exists(os.environ["XDG_CACHE_HOME"]): + os.makedirs(os.environ["XDG_CACHE_HOME"]) # setup the config dir as a symlink to a other dir canary = os.path.join(self.temp_dir, "canary")