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

Method test_connect_timeout

tests/test_connector.py:286–295  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

284 connection.close()
285
286 def test_connect_timeout(self):
287 conn = aiohttp.BaseConnector(loop=self.loop)
288 conn._create_connection = unittest.mock.Mock()
289 conn._create_connection.return_value = asyncio.Future(loop=self.loop)
290 conn._create_connection.return_value.set_exception(
291 asyncio.TimeoutError())
292
293 with self.assertRaises(aiohttp.ClientTimeoutError):
294 req = unittest.mock.Mock()
295 self.loop.run_until_complete(conn.connect(req))
296
297 def test_connect_oserr(self):
298 conn = aiohttp.BaseConnector(loop=self.loop)

Callers

nothing calls this directly

Calls 2

connectMethod · 0.95
set_exceptionMethod · 0.45

Tested by

no test coverage detected