From 00d19d90f7f4d90c91171d7c8ad0ca9f9e676d6c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:13:53 +0000 Subject: [PATCH] test: verify verify_checksum behavior when file is missing Added a new test case `test_verify_checksum_missing` to `src/tests/test_checksum_utils.py` to ensure that `verify_checksum` correctly raises `FileNotFoundError` and logs an appropriate error message when the checksum file does not exist. This improves diagnostic reliability for checksum verification failures. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- src/tests/test_checksum_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tests/test_checksum_utils.py b/src/tests/test_checksum_utils.py index 816462aa..cf1e1e5c 100644 --- a/src/tests/test_checksum_utils.py +++ b/src/tests/test_checksum_utils.py @@ -2,6 +2,7 @@ import hashlib import json from pathlib import Path +import pytest from utils import checksum @@ -45,3 +46,11 @@ def test_initialize_checksum(tmp_path): assert checksum.initialize_checksum(str(data), str(chk_file)) expected = hashlib.sha256("payload".encode()).hexdigest() assert chk_file.read_text() == expected + + +def test_verify_checksum_missing(tmp_path, caplog): + missing_file = tmp_path / "missing_chk.txt" + with pytest.raises(FileNotFoundError): + checksum.verify_checksum("abc", str(missing_file)) + + assert f"Checksum file '{missing_file}' not found." in caplog.text