Skip container signature verification during the tests

This is not required, and skipping them allows to make the whole
test-suite run faster.
This commit is contained in:
Alexis Métaireau 2025-04-17 17:26:11 +02:00
parent 77be24858c
commit 545e2156b5
No known key found for this signature in database
GPG key ID: C65C7A89A8FFC56E
3 changed files with 15 additions and 2 deletions

View file

@ -423,7 +423,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
"""

View file

@ -112,6 +112,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"

View file

@ -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")