(test_client_factory: TestClientFactory)
| 65 | |
| 66 | |
| 67 | def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None: |
| 68 | class WebSocketApp(WebSocketEndpoint): |
| 69 | async def on_connect(self, websocket: WebSocket) -> None: |
| 70 | assert websocket["subprotocols"] == ["soap", "wamp"] |
| 71 | await websocket.accept(subprotocol="wamp") |
| 72 | |
| 73 | client = test_client_factory(WebSocketApp) |
| 74 | with client.websocket_connect("/ws", subprotocols=["soap", "wamp"]) as websocket: |
| 75 | assert websocket.accepted_subprotocol == "wamp" |
| 76 | |
| 77 | |
| 78 | def test_websocket_endpoint_on_receive_bytes( |
nothing calls this directly
no test coverage detected