mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-01 19:22:23 +02:00
make the signature tests pass
This commit is contained in:
parent
26638a5f2a
commit
87a00d0f38
1 changed files with 11 additions and 0 deletions
|
@ -228,8 +228,19 @@ def test_store_signatures_with_different_digests(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Mock get_last_log_index
|
# Mock get_last_log_index
|
||||||
|
mocker.patch(
|
||||||
|
"dangerzone.updater.signatures.get_last_log_index",
|
||||||
|
return_value=50,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Call store_signatures
|
||||||
|
with pytest.raises(errors.SignatureMismatch):
|
||||||
|
store_signatures(signatures, image_digest, TEST_PUBKEY_PATH)
|
||||||
|
|
||||||
# Verify that the signatures file was not created
|
# Verify that the signatures file was not created
|
||||||
assert not (signatures_path / f"{image_digest}.json").exists()
|
assert not (signatures_path / f"{image_digest}.json").exists()
|
||||||
|
|
||||||
|
# Verify that the log index file was not updated
|
||||||
assert not (signatures_path / "last_log_index").exists()
|
assert not (signatures_path / "last_log_index").exists()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue