fix: Temp dir path might contain underscores

This commit is contained in:
jo 2021-05-29 18:11:54 +02:00
parent 21c8aa65db
commit 23d02bf959

View file

@ -99,12 +99,13 @@ def test_double_duplicate_files(src_dir, dest_dir):
# thanks to us mocking out time.localtime()
metadata2 = import_and_restore(src_dir, dest_dir)
# Check if file exists and if filename is <original>_<date>.<ext>
assert os.path.exists(metadata1["full_path"])
# Check if filename is <original>_<date>.<ext>
assert len(metadata1["full_path"].split("_")) == 2
assert len(os.path.basename(metadata1["full_path"]).split("_")) == 2
# Check if file exists and if filename is <original>_<date>_<uuid>.<ext>
assert os.path.exists(metadata2["full_path"])
# Check if filename is <original>_<date>_<uuid>.<ext>
assert len(metadata2["full_path"].split("_")) == 3
assert len(os.path.basename(metadata2["full_path"]).split("_")) == 3
def test_bad_permissions_destination_dir(src_dir):