diff --git a/ruff.toml b/ruff.toml index 3a4fb14..9d2413c 100755 --- a/ruff.toml +++ b/ruff.toml @@ -159,7 +159,7 @@ convention = "google" [lint.per-file-ignores] "tests/fixtures/sample_type_aliases.py" = [ - "UP040", # Type alias uses `TypeAlias` annotation instead of the `type` keyword + "UP040", # Intentionally using TypeAlias for backwards compatibility testing ] "tests/*.py" = [ "ANN", diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index 17039e9..3cc2e17 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -147,3 +147,12 @@ def test_read_manifest_returns_none_on_invalid_types(self, manager): # Should be a dict, not a list manager.manifest_path.write_text("[]", encoding="utf-8") assert manager.read_manifest() is None + + def test_read_manifest_returns_none_on_invalid_entry_format(self, manager): + manager.snapshot_dir.mkdir(parents=True, exist_ok=True) + # Entry missing required keys will raise TypeError in SnapshotEntry(**e) + manager.manifest_path.write_text( + '{"timestamp": "2024-01-01T00:00:00Z", "entries": [{"invalid_key": "value"}]}', + encoding="utf-8", + ) + assert manager.read_manifest() is None