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

Function test_handle_cancel

tests/test_server.py:395–410  ·  view source on GitHub ↗
(make_srv, loop)

Source from the content-addressed store, hash-verified

393
394
395def test_handle_cancel(make_srv, loop):
396 log = mock.Mock()
397 transport = mock.Mock()
398
399 srv = make_srv(logger=log, debug=True)
400 srv.connection_made(transport)
401 srv.writer = mock.Mock()
402 srv.handle_request = mock.Mock()
403
404 @asyncio.coroutine
405 def cancel():
406 srv._request_handler.cancel()
407
408 loop.run_until_complete(
409 asyncio.wait([srv._request_handler, cancel()], loop=loop))
410 assert log.debug.called
411
412
413def test_handle_cancelled(make_srv, loop):

Callers

nothing calls this directly

Calls 4

make_srvFunction · 0.85
cancelFunction · 0.85
waitMethod · 0.80
connection_madeMethod · 0.45

Tested by

no test coverage detected