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

Function test_has_request_context

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

Source from the content-addressed store, hash-verified

91
92
93async def test_has_request_context(http_scope: HTTPScope) -> None:
94 app = Quart(__name__)
95 headers, path, query_string = make_test_headers_path_and_query_string(app, "/")
96 request = Request(
97 "GET",
98 "http",
99 path,
100 query_string,
101 headers,
102 "",
103 "1.1",
104 http_scope,
105 send_push_promise=no_op_push,
106 )
107 async with RequestContext(Quart(__name__), request):
108 assert has_request_context() is True
109 assert has_app_context() is True
110 assert has_request_context() is False
111 assert has_app_context() is False
112
113
114async def test_has_app_context() -> None:

Callers

nothing calls this directly

Calls 6

QuartClass · 0.90
RequestClass · 0.90
RequestContextClass · 0.90
has_request_contextFunction · 0.90
has_app_contextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…