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

Function test_handle_error_debug

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

Source from the content-addressed store, hash-verified

301
302
303def test_handle_error_debug(srv):
304 transport = mock.Mock()
305 srv.debug = True
306 srv.connection_made(transport)
307 srv.writer = mock.Mock()
308
309 try:
310 raise ValueError()
311 except Exception as exc:
312 srv.handle_error(999, exc=exc)
313
314 content = b''.join(
315 [c[1][0] for c in list(srv.writer.write.mock_calls)])
316
317 assert b'HTTP/1.1 500 Internal' in content
318 assert b'Traceback (most recent call last):' in content
319
320
321def test_handle_error_500(make_srv):

Callers

nothing calls this directly

Calls 2

handle_errorMethod · 0.80
connection_madeMethod · 0.45

Tested by

no test coverage detected