Skip to content

Commit 5a73447

Browse files
author
alex-omophub
committed
Enhance integration tests for bulk search functionality
- Updated assertions in `test_bulk_basic_search` to verify that all expected search IDs are present in the results. - Added a check in `test_bulk_semantic_search` to confirm that the SNOMED vocabulary filter is applied to the results.
1 parent 9233f8a commit 5a73447

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/integration/test_search.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ def test_bulk_basic_multiple_queries(self, integration_client: OMOPHub) -> None:
315315
results = extract_data(result, "results")
316316
assert len(results) == 3
317317

318-
# Verify each search has results
318+
# Verify all 3 search IDs are present with results
319+
returned_ids = {item["search_id"] for item in results}
320+
assert returned_ids == {"q1", "q2", "q3"}
319321
for item in results:
320-
assert item["search_id"] in ("q1", "q2", "q3")
321322
assert item["status"] == "completed"
322323
assert len(item["results"]) > 0
323324

@@ -381,6 +382,10 @@ def test_bulk_semantic_with_filters(self, integration_client: OMOPHub) -> None:
381382
assert len(results) == 1
382383
assert results[0]["status"] == "completed"
383384

385+
# Verify SNOMED vocabulary filter was applied
386+
for concept in results[0]["results"]:
387+
assert concept.get("vocabulary_id") == "SNOMED"
388+
384389
def test_bulk_semantic_single_query(self, integration_client: OMOPHub) -> None:
385390
"""Test bulk semantic search with a single query."""
386391
result = integration_client.search.bulk_semantic([

0 commit comments

Comments
 (0)