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

Function test_standalone_ws_route_matches

tests/test_routing.py:606–613  ·  view source on GitHub ↗
(
    test_client_factory: TestClientFactory,
)

Source from the content-addressed store, hash-verified

604
605
606def test_standalone_ws_route_matches(
607 test_client_factory: TestClientFactory,
608) -> None:
609 app = WebSocketRoute("/", ws_helloworld)
610 client = test_client_factory(app)
611 with client.websocket_connect("/") as websocket:
612 text = websocket.receive_text()
613 assert text == "Hello, world!"
614
615
616def test_standalone_ws_route_does_not_match(

Callers

nothing calls this directly

Calls 4

WebSocketRouteClass · 0.90
test_client_factoryFunction · 0.85
websocket_connectMethod · 0.80
receive_textMethod · 0.45

Tested by

no test coverage detected