mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-04 12:41:50 +02:00
fixup! (WIP) Add tests
This commit is contained in:
parent
4621902a2b
commit
cf7a3dbb56
1 changed files with 13 additions and 2 deletions
|
@ -259,8 +259,19 @@ def test_stores_signatures_updates_last_log_index(valid_signature, mocker, tmp_p
|
||||||
with open(signatures_path / "last_log_index", "w") as f:
|
with open(signatures_path / "last_log_index", "w") as f:
|
||||||
f.write("50")
|
f.write("50")
|
||||||
|
|
||||||
def test_convert_oci_images_signatures():
|
# Mock get_log_index_from_signatures to return a higher value
|
||||||
pass
|
mocker.patch(
|
||||||
|
"dangerzone.updater.signatures.get_log_index_from_signatures",
|
||||||
|
return_value=100,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Call store_signatures
|
||||||
|
store_signatures(signatures, image_digest, TEST_PUBKEY_PATH)
|
||||||
|
|
||||||
|
# Verify that the log index file was updated
|
||||||
|
assert (signatures_path / "last_log_index").exists()
|
||||||
|
with open(signatures_path / "last_log_index", "r") as f:
|
||||||
|
assert f.read() == "100"
|
||||||
|
|
||||||
|
|
||||||
def test_is_update_available_nothing_local():
|
def test_is_update_available_nothing_local():
|
||||||
|
|
Loading…
Reference in a new issue