MCPcopy
hub / github.com/apache/caldera / knowledge_webapp

Function knowledge_webapp

tests/api/v2/test_knowledge.py:45–62  ·  view source on GitHub ↗
(event_loop, base_world, data_svc)

Source from the content-addressed store, hash-verified

43
44@pytest.fixture
45async def knowledge_webapp(event_loop, base_world, data_svc):
46 app_svc = AppService(web.Application())
47 app_svc.add_service('auth_svc', AuthService())
48 app_svc.add_service('knowledge_svc', KnowledgeService())
49 app_svc.add_service('data_svc', DataService())
50 app_svc.add_service('event_svc', EventService())
51 app_svc.add_service('contact_svc', ContactService())
52 app_svc.add_service('file_svc', FileSvc()) # This needs to be done this way, or it we won't have a valid BaseWorld
53 services = app_svc.get_services()
54 app = web.Application(
55 middlewares=[
56 authentication_required_middleware_factory(services['auth_svc']),
57 json_request_validation_middleware
58 ]
59 )
60 FactApi(services).add_routes(app)
61 await app_svc.register_contacts()
62 return app
63
64
65async def test_display_facts(knowledge_webapp, aiohttp_client, fire_event_mock):

Callers

nothing calls this directly

Calls 13

register_contactsMethod · 0.95
AppServiceClass · 0.90
AuthServiceClass · 0.90
KnowledgeServiceClass · 0.90
DataServiceClass · 0.90
EventServiceClass · 0.90
ContactServiceClass · 0.90
FileSvcClass · 0.90
FactApiClass · 0.90
add_serviceMethod · 0.80
get_servicesMethod · 0.80

Tested by

no test coverage detected