async def test_aux_app(tmpworkdir, test_client): mktree(tmpworkdir, { 'test.txt': 'test value', }) app = create_auxiliary_app(static_path='.') cli = await test_client(app) r = await cli.get('/test.txt') assert r.status == 200 text = await r.text() assert text == 'test value'
async def test_aux_app(tmpworkdir, aiohttp_client): mktree(tmpworkdir, { 'test.txt': 'test value', }) app = create_auxiliary_app(static_path='.') async with await aiohttp_client(app) as cli: async with cli.get('/test.txt') as r: assert r.status == 200 text = await r.text() assert text == 'test value'
def aux_cli(test_client, loop): app = create_auxiliary_app(static_path='.') return loop.run_until_complete(test_client(app))
def aux_cli(aiohttp_client, event_loop): app = create_auxiliary_app(static_path='.') cli = event_loop.run_until_complete(aiohttp_client(app)) yield cli event_loop.run_until_complete(cli.close())
def aux_cli(test_client, loop): app = create_auxiliary_app(static_path='.') cli = loop.run_until_complete(test_client(app)) yield cli loop.run_until_complete(cli.close())