From 87a00d0f38429b53390efc19281709f0ec626812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 25 Feb 2025 15:44:46 +0100 Subject: [PATCH] make the signature tests pass --- tests/test_signatures.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_signatures.py b/tests/test_signatures.py index 5e4fdde..da9fb99 100644 --- a/tests/test_signatures.py +++ b/tests/test_signatures.py @@ -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()