From 55ee670ab004fd4b964188555ae9d05bff98c481 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Mon, 30 Oct 2023 13:57:17 -0700 Subject: Create temporary batch file for one test --- tests/test_parse.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/test_parse.py') 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 -- cgit v1.2.3