| 1169 | @pytest.mark.parametrize("send_body", [True, False]) |
| 1170 | async def test_poll_for_disconnect_repeated(send_body: bool) -> None: |
| 1171 | async def app_poll_disconnect(scope: Scope, receive: Receive, send: Send) -> None: |
| 1172 | for _ in range(2): |
| 1173 | msg = await receive() |
| 1174 | while msg["type"] == "http.request": |
| 1175 | msg = await receive() |
| 1176 | assert msg["type"] == "http.disconnect" |
| 1177 | await Response(b"good!")(scope, receive, send) |
| 1178 | |
| 1179 | class MyMiddleware(BaseHTTPMiddleware): |
| 1180 | async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: |