Skip to content

Commit 94bb396

Browse files
committed
fix: nitpick findings
1 parent a30c6b4 commit 94bb396

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/test_api_export.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ def test_get_state_reflects_saved_export(self, client, export_state_dir):
5858
assert body["exportedCount"] == 3
5959
assert body["lastExportTime"] == "2026-01-01T12:00:00"
6060

61+
def test_get_state_handles_non_dict_json(self, client, export_state_dir):
62+
state_path = export_state_dir / "export_state.json"
63+
state_path.write_text('["not","a","dict"]', encoding="utf-8")
64+
response = client.get("/api/export/state")
65+
assert response.status_code == 200
66+
body = response.get_json()
67+
assert isinstance(body, dict)
68+
assert body == {}
69+
6170

6271
class TestExportHappyPath:
6372
def test_post_returns_zip_with_markdown_entry(self, client, export_state_dir):

0 commit comments

Comments
 (0)