MCPcopy Index your code
hub / github.com/encode/starlette / test_websocket_raw_path_without_params

Function test_websocket_raw_path_without_params

tests/test_testclient.py:414–425  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

412
413
414def test_websocket_raw_path_without_params(test_client_factory: TestClientFactory) -> None:
415 async def app(scope: Scope, receive: Receive, send: Send) -> None:
416 websocket = WebSocket(scope, receive=receive, send=send)
417 await websocket.accept()
418 raw_path = scope.get("raw_path")
419 assert raw_path is not None
420 await websocket.send_bytes(raw_path)
421
422 client = test_client_factory(app)
423 with client.websocket_connect("/hello-world", params={"foo": "bar"}) as websocket:
424 data = websocket.receive_bytes()
425 assert data == b"/hello-world"
426
427
428def test_timeout_deprecation() -> None:

Callers

nothing calls this directly

Calls 3

receive_bytesMethod · 0.95
test_client_factoryFunction · 0.85
websocket_connectMethod · 0.80

Tested by

no test coverage detected