Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading