(http_protocol_cls: type[HTTPProtocol])
| 546 | |
| 547 | |
| 548 | async def test_exception_during_response(http_protocol_cls: type[HTTPProtocol]): |
| 549 | async def app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable): |
| 550 | await send({"type": "http.response.start", "status": 200}) |
| 551 | await send({"type": "http.response.body", "body": b"1", "more_body": True}) |
| 552 | raise Exception() |
| 553 | |
| 554 | protocol = get_connected_protocol(app, http_protocol_cls) |
| 555 | protocol.data_received(SIMPLE_GET_REQUEST) |
| 556 | await protocol.loop.run_one() |
| 557 | assert b"HTTP/1.1 500 Internal Server Error" not in protocol.transport.buffer |
| 558 | assert protocol.transport.is_closing() |
| 559 | |
| 560 | |
| 561 | async def test_no_response_returned(http_protocol_cls: type[HTTPProtocol]): |
nothing calls this directly
no test coverage detected