MCPcopy Create free account
hub / github.com/pallets/quart / test_bad_request_if_websocket_route

Function test_bad_request_if_websocket_route

tests/test_ctx.py:52–69  ·  view source on GitHub ↗
(http_scope: HTTPScope)

Source from the content-addressed store, hash-verified

50
51
52async 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
72async def test_after_this_request(http_scope: HTTPScope) -> None:

Callers

nothing calls this directly

Calls 3

QuartClass · 0.90
RequestClass · 0.90
RequestContextClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…