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

Function test_websocket_raise_websocket_exception

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

Source from the content-addressed store, hash-verified

245
246
247def test_websocket_raise_websocket_exception(client: TestClient) -> None:
248 with client.websocket_connect("/ws-raise-websocket") as session:
249 response = session.receive()
250 assert response == {
251 "type": "websocket.close",
252 "code": status.WS_1003_UNSUPPORTED_DATA,
253 "reason": "",
254 }
255
256
257def test_websocket_state(client: TestClient) -> None:

Callers

nothing calls this directly

Calls 2

websocket_connectMethod · 0.80
receiveMethod · 0.45

Tested by

no test coverage detected