(srv)
| 301 | |
| 302 | |
| 303 | def 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 | |
| 321 | def test_handle_error_500(make_srv): |
nothing calls this directly
no test coverage detected