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

Function aiohttp_client

tests/web_server/test_core_endpoints.py:21–43  ·  view source on GitHub ↗
(aiohttp_client)

Source from the content-addressed store, hash-verified

19
20@pytest.fixture
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)
44
45
46@pytest.fixture

Calls 1

initializeFunction · 0.70

Tested by

no test coverage detected