diff --git a/backend/pashub_fetcher/tests/test_pashub_client.py b/backend/pashub_fetcher/tests/test_pashub_client.py index fa23378d..c6e7b780 100644 --- a/backend/pashub_fetcher/tests/test_pashub_client.py +++ b/backend/pashub_fetcher/tests/test_pashub_client.py @@ -167,3 +167,24 @@ def test_get_evidence_files_by_job_id_returns_downloaded_files_with_empty_other_ assert isinstance(result, DownloadedFiles) assert result.core == ["/tmp/SiteNote_001.pdf"] assert result.other == [] + + +def test_get_evidence_files_by_job_id_downloads_other_files_when_include_other_true() -> None: + # Arrange + client = make_client() + files = [ + make_file(file_name="SiteNote_001.pdf"), + make_file(file_name="unknown_doc.pdf"), + ] + + # Act + with ( + patch.object(client, "_get_evidence_list", return_value=files), + patch.object(client, "_get_evidence_metadata", return_value=make_metadata()), + patch.object(client, "_download_file"), + ): + result = client.get_evidence_files_by_job_id("job-1", include_other=True) + + # Assert + assert result.core == ["/tmp/SiteNote_001.pdf"] + assert result.other == ["/tmp/unknown_doc.pdf"]