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

Function test_http_path_with_root_path

tests/test_asgi.py:190–210  ·  view source on GitHub ↗
(path: str, expected: str)

Source from the content-addressed store, hash-verified

188 [("/app", "/ "), ("/", "/ "), ("/app/", "/"), ("/app/2", "/2")],
189)
190def test_http_path_with_root_path(path: str, expected: str) -> None:
191 app = Quart(__name__)
192 scope: HTTPScope = {
193 "type": "http",
194 "asgi": {},
195 "http_version": "1.1",
196 "method": "GET",
197 "scheme": "https",
198 "path": path,
199 "raw_path": b"/",
200 "query_string": b"",
201 "root_path": "/app",
202 "headers": [(b"host", b"quart")],
203 "client": ("127.0.0.1", 80),
204 "server": None,
205 "extensions": {},
206 "state": {}, # type: ignore[typeddict-item]
207 }
208 connection = ASGIHTTPConnection(app, scope)
209 request = connection._create_request_from_scope(lambda: None) # type: ignore
210 assert request.path == expected
211
212
213def test_websocket_path_from_absolute_target() -> None:

Callers

nothing calls this directly

Calls 3

QuartClass · 0.90
ASGIHTTPConnectionClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…