MCPcopy
hub / github.com/encode/starlette / test_websocket_raw_path_without_params

Function test_websocket_raw_path_without_params

tests/test_testclient.py:414–425  ·  tests/test_testclient.py::test_websocket_raw_path_without_params
(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(class="st">"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(class="st">"/hello-world", params={class="st">"foo": class="st">"bar"}) as websocket:
424 data = websocket.receive_bytes()
425 assert data == bclass="st">"/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