MCPcopy
hub / github.com/aio-libs/aiohttp / test_client_ssl

Function test_client_ssl

tests/test_client_functional.py:232–250  ·  view source on GitHub ↗
(create_app_and_client, loop, ssl_ctx)

Source from the content-addressed store, hash-verified

230
231@pytest.mark.run_loop
232def test_client_ssl(create_app_and_client, loop, ssl_ctx):
233 connector = aiohttp.TCPConnector(verify_ssl=False, loop=loop)
234
235 @asyncio.coroutine
236 def handler(request):
237 return web.HTTPOk(text='Test message')
238
239 app, client = yield from create_app_and_client(
240 server_params=dict(ssl_ctx=ssl_ctx),
241 client_params=dict(connector=connector))
242 app.router.add_route('GET', '/', handler)
243
244 resp = yield from client.get('/')
245 try:
246 assert 200 == resp.status
247 txt = yield from resp.text()
248 assert txt == 'Test message'
249 finally:
250 yield from resp.release()
251
252
253@pytest.mark.parametrize('fingerprint', [

Callers

nothing calls this directly

Calls 5

create_app_and_clientFunction · 0.85
add_routeMethod · 0.45
getMethod · 0.45
textMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected