(test_client_factory: TestClientFactory)
| 16 | |
| 17 | |
| 18 | def test_websocket_url(test_client_factory: TestClientFactory) -> None: |
| 19 | async def app(scope: Scope, receive: Receive, send: Send) -> None: |
| 20 | websocket = WebSocket(scope, receive=receive, send=send) |
| 21 | await websocket.accept() |
| 22 | await websocket.send_json({class="st">"url": str(websocket.url)}) |
| 23 | await websocket.close() |
| 24 | |
| 25 | client = test_client_factory(app) |
| 26 | with client.websocket_connect(class="st">"/123?a=abc") as websocket: |
| 27 | data = websocket.receive_json() |
| 28 | assert data == {class="st">"url": class="st">"ws://testserver/123?a=abc"} |
| 29 | |
| 30 | |
| 31 | def test_websocket_binary_json(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected