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

Function test_websocket_repr

tests/test_exceptions.py:171–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169
170
171def test_websocket_repr() -> None:
172 assert repr(WebSocketException(1008, reason="Policy Violation")) == (
173 "WebSocketException(code=1008, reason='Policy Violation')"
174 )
175
176 class CustomWebSocketException(WebSocketException):
177 pass
178
179 assert (
180 repr(CustomWebSocketException(1013, reason="Something custom"))
181 == "CustomWebSocketException(code=1013, reason='Something custom')"
182 )
183
184
185def test_request_in_app_and_handler_is_the_same_object(client: TestClient) -> None:

Callers

nothing calls this directly

Calls 2

WebSocketExceptionClass · 0.90

Tested by

no test coverage detected