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

Function test_router_add_websocket_route

tests/test_routing.py:307–314  ·  view source on GitHub ↗
(client: TestClient)

Source from the content-addressed store, hash-verified

305
306
307def test_router_add_websocket_route(client: TestClient) -> None:
308 with client.websocket_connect("/ws") as session:
309 text = session.receive_text()
310 assert text == "Hello, world!"
311
312 with client.websocket_connect("/ws/test") as session:
313 text = session.receive_text()
314 assert text == "Hello, test!"
315
316
317def test_router_middleware(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 2

websocket_connectMethod · 0.80
receive_textMethod · 0.45

Tested by

no test coverage detected