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

Function test_handle_error

tests/test_server.py:247–258  ·  view source on GitHub ↗
(srv)

Source from the content-addressed store, hash-verified

245
246
247def test_handle_error(srv):
248 transport = mock.Mock()
249 srv.connection_made(transport)
250 srv.keep_alive(True)
251 srv.writer = mock.Mock()
252
253 srv.handle_error(404, headers=(('X-Server', 'asyncio'),))
254 content = b''.join(
255 [c[1][0] for c in list(srv.writer.write.mock_calls)])
256 assert b'HTTP/1.1 404 Not Found' in content
257 assert b'X-SERVER: asyncio' in content
258 assert not srv._keep_alive
259
260
261def test_handle_error__utf(make_srv):

Callers

nothing calls this directly

Calls 3

handle_errorMethod · 0.80
connection_madeMethod · 0.45
keep_aliveMethod · 0.45

Tested by

no test coverage detected