make the signature tests pass

This commit is contained in:
Alexis Métaireau 2025-02-25 15:44:46 +01:00
parent 26638a5f2a
commit 87a00d0f38
No known key found for this signature in database
GPG key ID: C65C7A89A8FFC56E

View file

@ -228,8 +228,19 @@ def test_store_signatures_with_different_digests(
)
# 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
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()