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

Function test_handle_request

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

Source from the content-addressed store, hash-verified

38
39
40def test_handle_request(srv):
41 transport = mock.Mock()
42
43 srv.connection_made(transport)
44 srv.writer = mock.Mock()
45
46 message = mock.Mock()
47 message.headers = []
48 message.version = (1, 1)
49 srv.handle_request(message, mock.Mock())
50
51 content = b''.join(
52 [c[1][0] for c in list(srv.writer.write.mock_calls)])
53 assert content.startswith(b'HTTP/1.1 404 Not Found\r\n')
54
55
56def test_closing(srv):

Callers

nothing calls this directly

Calls 2

connection_madeMethod · 0.45
handle_requestMethod · 0.45

Tested by

no test coverage detected