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

Function test_websocket_raise_custom_exception

tests/test_applications.py:271–278  ·  view source on GitHub ↗
(client: TestClient)

Source from the content-addressed store, hash-verified

269
270
271def test_websocket_raise_custom_exception(client: TestClient) -> None:
272 with client.websocket_connect("/ws-raise-custom") as session:
273 response = session.receive()
274 assert response == {
275 "type": "websocket.close",
276 "code": status.WS_1013_TRY_AGAIN_LATER,
277 "reason": "",
278 }
279
280
281def test_middleware(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 2

websocket_connectMethod · 0.80
receiveMethod · 0.45

Tested by

no test coverage detected