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

Function app

tests/test_websockets.py:19–23  ·  tests/test_websockets.py::app
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

17
18def 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:

Callers 1

Calls 15

acceptMethod · 0.95
send_jsonMethod · 0.95
closeMethod · 0.95
receive_jsonMethod · 0.95
receive_textMethod · 0.95
send_textMethod · 0.95
receive_bytesMethod · 0.95
send_bytesMethod · 0.95
iter_textMethod · 0.95
iter_bytesMethod · 0.95
iter_jsonMethod · 0.95
receiveMethod · 0.95

Tested by

no test coverage detected