From aa1d41f7c57bc4b83dbf710bcacaff59691205a6 Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:09:19 -0800 Subject: [PATCH] Chore: trim the pdftoppm argument test to timeout and resolution --- src/documents/tests/test_parsers.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/documents/tests/test_parsers.py b/src/documents/tests/test_parsers.py index bfb7eb4716..f0110caf98 100644 --- a/src/documents/tests/test_parsers.py +++ b/src/documents/tests/test_parsers.py @@ -458,7 +458,7 @@ class TestRasterizePdfPageToPng: assert not out_path.exists() - def test_arguments_and_timeout_are_passed_to_pdftoppm( + def test_timeout_and_resolution_are_passed_to_pdftoppm( self, tmp_path: Path, mocker: MockerFixture, @@ -467,9 +467,10 @@ class TestRasterizePdfPageToPng: GIVEN: - A subprocess runner that succeeds WHEN: - - Page 4 is rasterized with a timeout + - Page 4 is rasterized at a non-72 dpi with a timeout THEN: - - pdftoppm renders only that page and the timeout reaches the runner + - The timeout reaches the runner + - The resolution is passed to pdftoppm """ run = mocker.patch("documents.parsers.run_subprocess") @@ -482,12 +483,7 @@ class TestRasterizePdfPageToPng: ) args = run.call_args.args[0] - assert args[args.index("-f") + 1] == "4" - assert args[args.index("-l") + 1] == "4" assert args[args.index("-r") + 1] == "150" - assert "-singlefile" in args - assert "-cropbox" in args - assert args[-1] == str(tmp_path / "out") assert run.call_args.kwargs["timeout"] == 12 def test_timeout_raises_parse_error(