(http_scope: HTTPScope)
| 28 | |
| 29 | |
| 30 | async def test_request_context_match(http_scope: HTTPScope) -> None: |
| 31 | app = Quart(__name__) |
| 32 | url_adapter = Mock() |
| 33 | rule = QuartRule("/", methods={"GET"}, endpoint="index") |
| 34 | url_adapter.match.return_value = (rule, {"arg": "value"}) |
| 35 | app.create_url_adapter = lambda *_: url_adapter # type: ignore |
| 36 | request = Request( |
| 37 | "GET", |
| 38 | "http", |
| 39 | "/", |
| 40 | b"", |
| 41 | Headers([("host", "quart.com")]), |
| 42 | "", |
| 43 | "1.1", |
| 44 | http_scope, |
| 45 | send_push_promise=no_op_push, |
| 46 | ) |
| 47 | async with RequestContext(app, request): |
| 48 | assert request.url_rule == rule |
| 49 | assert request.view_args == {"arg": "value"} |
| 50 | |
| 51 | |
| 52 | async def test_bad_request_if_websocket_route(http_scope: HTTPScope) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…