diff --git a/tests/test_search_service_nondict_rows.py b/tests/test_search_service_nondict_rows.py index 1e1b179..fc6ae3c 100644 --- a/tests/test_search_service_nondict_rows.py +++ b/tests/test_search_service_nondict_rows.py @@ -3,18 +3,18 @@ import asyncio import services.search.service as svc_mod from services.search.service import SearchService - def test_search_skips_non_dict_results(monkeypatch): # comprehensive_web_search aggregates external provider + cache results; # a malformed row (string/None) made the old loop call r.get and crash, # losing the whole search. - async def fake_search(query, max_results=10, fetch_content=False): - return [ - {"url": "https://a.com", "title": "A", "snippet": "x"}, + def fake_search(query, max_pages=10, return_sources=False): + results = [ + {"url": "https://a.com", "title": "A"}, "junk-row", None, - {"url": "https://b.com", "title": "B", "snippet": "y"}, + {"url": "https://b.com", "title": "B"}, ] + return ("", results) monkeypatch.setattr(svc_mod, "comprehensive_web_search", fake_search) svc = SearchService()