(path: str, expected: str)
| 238 | [("/app", "/ "), ("/", "/ "), ("/app/", "/"), ("/app/2", "/2")], |
| 239 | ) |
| 240 | def 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( |
nothing calls this directly
no test coverage detected
searching dependent graphs…