(srv)
| 245 | |
| 246 | |
| 247 | def 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 | |
| 261 | def test_handle_error__utf(make_srv): |
nothing calls this directly
no test coverage detected