MCPcopy
hub / github.com/aio-libs/aiohttp / test_receive_timeouterror

Method test_receive_timeouterror

tests/test_web_websocket.py:306–317  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

304 self.loop.run_until_complete, ws.receive())
305
306 def test_receive_timeouterror(self):
307 req = self.make_request('GET', '/')
308 ws = WebSocketResponse()
309 self.loop.run_until_complete(ws.prepare(req))
310
311 res = asyncio.Future(loop=self.loop)
312 res.set_exception(asyncio.TimeoutError())
313 ws._reader.read.return_value = res
314
315 self.assertRaises(
316 asyncio.TimeoutError,
317 self.loop.run_until_complete, ws.receive())
318
319 def test_receive_client_disconnected(self):
320 req = self.make_request('GET', '/')

Callers

nothing calls this directly

Calls 5

make_requestMethod · 0.95
prepareMethod · 0.95
receiveMethod · 0.95
WebSocketResponseClass · 0.90
set_exceptionMethod · 0.45

Tested by

no test coverage detected