diff --git a/dangerzone/updater/signatures.py b/dangerzone/updater/signatures.py index a8f7747..e4cf5d7 100644 --- a/dangerzone/updater/signatures.py +++ b/dangerzone/updater/signatures.py @@ -424,7 +424,7 @@ def store_signatures( write_log_index(get_log_index_from_signatures(signatures)) -def verify_local_image(image: str, pubkey: str) -> bool: +def verify_local_image(image: str, pubkey: str = DEFAULT_PUBKEY_LOCATION) -> bool: """ Verifies that a local image has a valid signature """ diff --git a/tests/conftest.py b/tests/conftest.py index 1b8a9ca..f413d11 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -119,6 +119,14 @@ def sample_pdf() -> str: return str(test_docs_dir.joinpath(BASIC_SAMPLE_PDF)) +@pytest.fixture +def skip_image_verification(monkeypatch): + def noop(*args, **kwargs): + return True + + monkeypatch.setattr(container, "verify_local_image", noop) + + SAMPLE_DIRECTORY = "test_docs" BASIC_SAMPLE_PDF = "sample-pdf.pdf" BASIC_SAMPLE_DOC = "sample-doc.doc" diff --git a/tests/isolation_provider/test_container.py b/tests/isolation_provider/test_container.py index fc74eb3..81f147d 100644 --- a/tests/isolation_provider/test_container.py +++ b/tests/isolation_provider/test_container.py @@ -22,7 +22,7 @@ elif os.environ.get("DUMMY_CONVERSION", False): @pytest.fixture -def provider() -> Container: +def provider(skip_image_verification: None) -> Container: return Container() diff --git a/tests/test_cli.py b/tests/test_cli.py index dbaa880..ffb6022 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -202,7 +202,12 @@ class TestCliConversion(TestCliBasic): result.assert_success() @for_each_doc - def test_formats(self, doc: Path, tmp_path_factory: pytest.TempPathFactory) -> None: + def test_formats( + self, + doc: Path, + tmp_path_factory: pytest.TempPathFactory, + skip_image_verification: pytest.FixtureRequest, + ) -> None: reference = (doc.parent / "reference" / doc.stem).with_suffix(".pdf") destination = tmp_path_factory.mktemp(doc.stem).with_suffix(".pdf")