From 7b5a88e7ac772bc6b767041272dce68aed0ccf05 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 22 Jul 2026 12:58:56 +0000 Subject: [PATCH] =?UTF-8?q?Treat=20a=20missing=20totalItemCount=20as=20a?= =?UTF-8?q?=20complete=20evidence=20list=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/pashub_fetcher/tests/test_pashub_client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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