(http_scope: HTTPScope)
| 50 | |
| 51 | |
| 52 | async def test_bad_request_if_websocket_route(http_scope: HTTPScope) -> None: |
| 53 | app = Quart(__name__) |
| 54 | url_adapter = Mock() |
| 55 | url_adapter.match.side_effect = BadRequest() |
| 56 | app.create_url_adapter = lambda *_: url_adapter # type: ignore |
| 57 | request = Request( |
| 58 | "GET", |
| 59 | "http", |
| 60 | "/", |
| 61 | b"", |
| 62 | Headers([("host", "quart.com")]), |
| 63 | "", |
| 64 | "1.1", |
| 65 | http_scope, |
| 66 | send_push_promise=no_op_push, |
| 67 | ) |
| 68 | async with RequestContext(app, request): |
| 69 | assert isinstance(request.routing_exception, BadRequest) |
| 70 | |
| 71 | |
| 72 | async def test_after_this_request(http_scope: HTTPScope) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…