MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / handler

Function handler

tests/test_client_ws_functional.py:38–45  ·  view source on GitHub ↗
(request: web.Request)

Source from the content-addressed store, hash-verified

36
37async def test_send_recv_text(aiohttp_client: AiohttpClient) -> None:
38 async def handler(request: web.Request) -> web.WebSocketResponse:
39 ws = web.WebSocketResponse()
40 await ws.prepare(request)
41
42 msg = await ws.receive_str()
43 await ws.send_str(msg + "/answer")
44 await ws.close()
45 return ws
46
47 app = web.Application()
48 app.router.add_route("GET", "/", handler)

Callers

nothing calls this directly

Calls 15

prepareMethod · 0.95
receive_strMethod · 0.95
send_strMethod · 0.95
closeMethod · 0.95
receive_bytesMethod · 0.95
send_bytesMethod · 0.95
receive_jsonMethod · 0.95
send_jsonMethod · 0.95
receiveMethod · 0.95
send_json_bytesMethod · 0.95
send_frameMethod · 0.95
pingMethod · 0.95

Tested by

no test coverage detected