From 5f939f6651a6551c81b61933f2f9cc63b84c2073 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 3 Feb 2020 10:09:48 +0100 Subject: [PATCH] fix check for symlink path in unittest os.path.exists() will return false in the event that it is passed a broken symlink which defeats the point of testing whether the link itself exists. use path.lexist() instead which properly checks with O_NOFOLLOW. --- testing/test_deltatar.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testing/test_deltatar.py b/testing/test_deltatar.py index adfcfbb..ae5e183 100644 --- a/testing/test_deltatar.py +++ b/testing/test_deltatar.py @@ -1883,7 +1883,7 @@ class DeltaTarTest(BaseTest): # retrieve the first item it finds for a given path which in the case # at hand is a symlink to some non-existent path fullpath = os.path.join("source_dir", testpath) - assert not os.path.exists(fullpath) + assert not os.path.lexists(fullpath) def fsapi_access_true (self): -- 1.7.1