diff --git a/backend/pashub_fetcher/tests/test_pashub_client.py b/backend/pashub_fetcher/tests/test_pashub_client.py index 52b9e4645..5ab61b111 100644 --- a/backend/pashub_fetcher/tests/test_pashub_client.py +++ b/backend/pashub_fetcher/tests/test_pashub_client.py @@ -408,3 +408,16 @@ def test_get_evidence_list_returns_all_files_when_count_matches_total() -> None: # Assert assert [f.file_id for f in result] == ["id-0", "id-1", "id-2"] + + +def test_get_evidence_list_assumes_complete_when_total_item_count_absent() -> None: + # Arrange — a PasHub schema change that drops the field must not fail the fetch + client = make_client() + payload = {"results": [make_evidence_item()]} + client.session.get = MagicMock(return_value=make_response(payload=payload)) + + # Act + result = client._get_evidence_list("job-1") + + # Assert + assert len(result) == 1