aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Logan <cody@lokken.dev>2023-10-30 13:57:17 -0700
committerCody Logan <cody@lokken.dev>2023-10-30 13:57:17 -0700
commit55ee670ab004fd4b964188555ae9d05bff98c481 (patch)
tree25fe5509fc23b0d3a08e9dba19978da86518885b
parent27376c3f3ec667fd83c3603652f11d4125b90e5c (diff)
downloadwikiget-55ee670ab004fd4b964188555ae9d05bff98c481.tar.gz
wikiget-55ee670ab004fd4b964188555ae9d05bff98c481.zip
Create temporary batch file for one test
-rw-r--r--tests/test_parse.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 0d33e74..79ac490 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -85,10 +85,14 @@ class TestReadBatchFile:
tmp_file.write_text("File:Foo.jpg\nFile:Bar.jpg\nFile:Baz.jpg\n")
return read_batch_file(str(tmp_file))
- def test_batch_file_log(self, caplog: pytest.LogCaptureFixture) -> None:
+ def test_batch_file_log(
+ self, caplog: pytest.LogCaptureFixture, tmp_path: Path
+ ) -> None:
caplog.set_level(logging.INFO)
- _ = read_batch_file("batch.txt")
- assert "Using file 'batch.txt' for batch download" in caplog.text
+ tmp_file = tmp_path / "batch.txt"
+ tmp_file.write_text("File:Foo.jpg\n")
+ _ = read_batch_file(str(tmp_file))
+ assert f"Using file '{tmp_file}' for batch download" in caplog.text
def test_batch_file_length(self, dl_list: Dict[int, str]) -> None:
assert len(dl_list) == 3