24 lines
1003 B
Python
24 lines
1003 B
Python
from app.services.context_cache_service.mixin_profile_basics import ContextCacheProfileBasicsMixin
|
|
from app.services.context_cache_service.mixin_profile_route_parser import ContextCacheProfileRouteParserMixin
|
|
|
|
|
|
def _find_route(items: list[dict], route: str) -> dict:
|
|
for item in items:
|
|
if str(item.get("route") or "") == route:
|
|
return item
|
|
raise AssertionError(f"route not found in catalog: {route}")
|
|
|
|
|
|
def test_default_feature_catalog_uses_canonical_rag_ask() -> None:
|
|
items = ContextCacheProfileBasicsMixin._default_feature_catalog_items()
|
|
ai_steward_item = _find_route(items, "/ai-steward")
|
|
apis = list(ai_steward_item.get("apis") or [])
|
|
assert "/rag/ask" in apis
|
|
assert "/ai-steward/rag/ask" not in apis
|
|
|
|
|
|
def test_route_feature_summary_uses_canonical_rag_ask() -> None:
|
|
_summary, apis, _aliases = ContextCacheProfileRouteParserMixin._route_feature_summary("/ai-steward")
|
|
assert "/rag/ask" in apis
|
|
assert "/ai-steward/rag/ask" not in apis
|