mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
Search: consolidate core and provider implementations
Co-authored-by: ghreprimand <203024559+ghreprimand@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""Search consolidation regression tests.
|
||||
|
||||
``src.search`` is still a public import path for agent/deep-research code, but
|
||||
core/provider behavior should come from the services.search implementation.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
|
||||
|
||||
def test_src_search_core_aliases_services_core():
|
||||
src_core = importlib.import_module("src.search.core")
|
||||
service_core = importlib.import_module("services.search.core")
|
||||
|
||||
assert src_core is service_core
|
||||
assert src_core.comprehensive_web_search is service_core.comprehensive_web_search
|
||||
assert src_core.invalidate_search_cache is service_core.invalidate_search_cache
|
||||
|
||||
|
||||
def test_src_search_providers_aliases_services_providers():
|
||||
src_providers = importlib.import_module("src.search.providers")
|
||||
service_providers = importlib.import_module("services.search.providers")
|
||||
|
||||
assert src_providers is service_providers
|
||||
assert src_providers._resolve_ddg_redirect is service_providers._resolve_ddg_redirect
|
||||
assert src_providers._safesearch_for is service_providers._safesearch_for
|
||||
|
||||
|
||||
def test_src_search_package_exports_still_resolve():
|
||||
import src.search as search
|
||||
import services.search as service_search
|
||||
|
||||
assert search.comprehensive_web_search is service_search.comprehensive_web_search
|
||||
assert search.searxng_search_results is service_search.searxng_search_results
|
||||
assert search.searxng_search_api is service_search.searxng_search_api
|
||||
assert search.PROVIDER_INFO is service_search.PROVIDER_INFO
|
||||
@@ -1,8 +1,7 @@
|
||||
"""Regression tests for the services.search provider copy.
|
||||
"""Regression tests for the canonical services.search provider implementation.
|
||||
|
||||
The UI search routes import services.search, while agent/deep-research paths
|
||||
still import src.search. Keep the service-side copy aligned with the safer
|
||||
provider guards already present in src.search.
|
||||
The old src.search provider path aliases this module; these tests pin the
|
||||
behavior at the single implementation point.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user