From 9bf663fdb92ebbfddcaccbcf60cd4f8bfa383906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 25 Feb 2025 15:44:08 +0100 Subject: [PATCH] fixup! (WIP) Add tests --- tests/test_signatures.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_signatures.py b/tests/test_signatures.py index c7ca9b4..8e3814f 100644 --- a/tests/test_signatures.py +++ b/tests/test_signatures.py @@ -274,8 +274,16 @@ def test_stores_signatures_updates_last_log_index(valid_signature, mocker, tmp_p assert f.read() == "100" -def test_is_update_available_nothing_local(): - pass +def test_is_update_available_when_no_local_image(mocker): + """ + Test that is_update_available returns True when no local image is + currently present. + """ + # Mock container_image_exists to return False + mocker.patch( + "dangerzone.container_utils.get_local_image_digest", + side_effect=dzerrors.ImageNotPresentException, + ) def test_is_update_available_trims():