UT: Fix assert logic in test_delete_files_by_pattern()

This commit is contained in:
Shreya Malviya 2022-09-28 18:14:48 +05:30
parent f61e734d29
commit 30d3124cb4
1 changed files with 4 additions and 4 deletions

View File

@ -146,11 +146,11 @@ def test_open_locked_file(tmp_path, monkeypatch):
def test_delete_files_by_pattern(tmp_path):
for filename in ["xyz-1.txt", "abc-2.txt", "pqr-3.txt", "abc-4.txt"]:
for filename in {"xyz-1.txt", "abc-2.txt", "pqr-3.txt", "abc-4.txt", "abc-5.pdf"}:
(tmp_path / filename).touch()
fss = LocalStorageFileRepository(tmp_path)
fss.delete_files_by_pattern("abc-*")
fss.delete_files_by_pattern("abc-*.txt")
files = list(tmp_path.iterdir())
assert len(files) == 2
files = {f.name for f in tmp_path.iterdir()}
assert files == {"xyz-1.txt", "pqr-3.txt", "abc-5.pdf"}