forked from p15670423/monkey
UT: Fix assert logic in test_delete_files_by_pattern()
This commit is contained in:
parent
f61e734d29
commit
30d3124cb4
|
@ -146,11 +146,11 @@ def test_open_locked_file(tmp_path, monkeypatch):
|
||||||
|
|
||||||
|
|
||||||
def test_delete_files_by_pattern(tmp_path):
|
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()
|
(tmp_path / filename).touch()
|
||||||
|
|
||||||
fss = LocalStorageFileRepository(tmp_path)
|
fss = LocalStorageFileRepository(tmp_path)
|
||||||
fss.delete_files_by_pattern("abc-*")
|
fss.delete_files_by_pattern("abc-*.txt")
|
||||||
|
|
||||||
files = list(tmp_path.iterdir())
|
files = {f.name for f in tmp_path.iterdir()}
|
||||||
assert len(files) == 2
|
assert files == {"xyz-1.txt", "pqr-3.txt", "abc-5.pdf"}
|
||||||
|
|
Loading…
Reference in New Issue