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

Method test_receive_cancelled

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

Source from the content-addressed store, hash-verified

291 self.loop.run_until_complete(go())
292
293 def test_receive_cancelled(self):
294 req = self.make_request('GET', '/')
295 ws = WebSocketResponse()
296 self.loop.run_until_complete(ws.prepare(req))
297
298 res = asyncio.Future(loop=self.loop)
299 res.set_exception(asyncio.CancelledError())
300 ws._reader.read.return_value = res
301
302 self.assertRaises(
303 asyncio.CancelledError,
304 self.loop.run_until_complete, ws.receive())
305
306 def test_receive_timeouterror(self):
307 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