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

Method test_cleanup3

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

Source from the content-addressed store, hash-verified

357 conn.close()
358
359 def test_cleanup3(self):
360 testset = {1: [(unittest.mock.Mock(), unittest.mock.Mock(), 290.1),
361 (unittest.mock.Mock(), unittest.mock.Mock(), 305.1)]}
362 testset[1][0][1].is_connected.return_value = True
363
364 loop = unittest.mock.Mock()
365 loop.time.return_value = 308.5
366
367 conn = aiohttp.BaseConnector(loop=loop, keepalive_timeout=10)
368 conn._conns = testset
369
370 conn._cleanup()
371 self.assertEqual(conn._conns, {1: [testset[1][1]]})
372
373 self.assertIsNotNone(conn._cleanup_handle)
374 loop.call_at.assert_called_with(
375 316, conn._cleanup)
376 conn.close()
377
378 def test_tcp_connector_ctor(self):
379 conn = aiohttp.TCPConnector(loop=self.loop)

Callers

nothing calls this directly

Calls 2

_cleanupMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected