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

Function test_websocket_path_with_root_path

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

Source from the content-addressed store, hash-verified

238 [("/app", "/ "), ("/", "/ "), ("/app/", "/"), ("/app/2", "/2")],
239)
240def test_websocket_path_with_root_path(path: str, expected: str) -> None:
241 app = Quart(__name__)
242 scope: WebsocketScope = {
243 "type": "websocket",
244 "asgi": {},
245 "http_version": "1.1",
246 "scheme": "wss",
247 "path": path,
248 "raw_path": b"/",
249 "query_string": b"",
250 "root_path": "/app",
251 "headers": [(b"host", b"quart")],
252 "client": ("127.0.0.1", 80),
253 "server": None,
254 "subprotocols": [],
255 "extensions": {"websocket.http.response": {}},
256 "state": {}, # type: ignore[typeddict-item]
257 }
258 connection = ASGIWebsocketConnection(app, scope)
259 websocket = connection._create_websocket_from_scope(lambda: None) # type: ignore
260 assert websocket.path == expected
261
262
263@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

QuartClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…