(test_client_factory: TestClientFactory)
| 62 | |
| 63 | |
| 64 | def test_websocket_query_params(test_client_factory: TestClientFactory) -> None: |
| 65 | async def app(scope: Scope, receive: Receive, send: Send) -> None: |
| 66 | websocket = WebSocket(scope, receive=receive, send=send) |
| 67 | query_params = dict(websocket.query_params) |
| 68 | await websocket.accept() |
| 69 | await websocket.send_json({class="st">"params": query_params}) |
| 70 | await websocket.close() |
| 71 | |
| 72 | client = test_client_factory(app) |
| 73 | with client.websocket_connect(class="st">"/?a=abc&b=456") as websocket: |
| 74 | data = websocket.receive_json() |
| 75 | assert data == {class="st">"params": {class="st">"a": class="st">"abc", class="st">"b": class="st">"456"}} |
| 76 | |
| 77 | |
| 78 | @pytest.mark.skipif( |
nothing calls this directly
no test coverage detected