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

Function initialize

tests/web_server/test_core_endpoints.py:23–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21async def aiohttp_client(aiohttp_client):
22
23 async def initialize():
24 with open(Path(__file__).parents[2] / 'conf' / 'default.yml', 'r') as fle:
25 BaseWorld.apply_config('main', yaml.safe_load(fle))
26 with open(Path(__file__).parents[2] / 'conf' / 'payloads.yml', 'r') as fle:
27 BaseWorld.apply_config('payloads', yaml.safe_load(fle))
28
29 app_svc = AppService(web.Application())
30 _ = DataService()
31 _ = RestService()
32 auth_svc = AuthService()
33 services = app_svc.get_services()
34 os.chdir(str(Path(__file__).parents[2]))
35
36 await app_svc.load_plugins(['sandcat', 'ssl'])
37 _ = await RestApi(services).enable()
38 await auth_svc.apply(app_svc.application, auth_svc.get_config('users'))
39 await auth_svc.set_login_handlers(services)
40 return app_svc.application
41
42 app = await initialize()
43 yield await aiohttp_client(app)

Callers 1

aiohttp_clientFunction · 0.70

Calls 12

load_pluginsMethod · 0.95
applyMethod · 0.95
set_login_handlersMethod · 0.95
AppServiceClass · 0.90
DataServiceClass · 0.90
RestServiceClass · 0.90
AuthServiceClass · 0.90
RestApiClass · 0.90
get_servicesMethod · 0.80
apply_configMethod · 0.45
enableMethod · 0.45
get_configMethod · 0.45

Tested by

no test coverage detected