(path: str, expected: str)
| 188 | [("/app", "/ "), ("/", "/ "), ("/app/", "/"), ("/app/2", "/2")], |
| 189 | ) |
| 190 | def 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 | |
| 213 | def test_websocket_path_from_absolute_target() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…