mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
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:
parent
1079f1335b
commit
4cedf5bf86
4 changed files with 16 additions and 3 deletions
|
@ -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
|
||||
"""
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in a new issue