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

Method test_cleanup2

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

Source from the content-addressed store, hash-verified

340 self.assertIsNone(conn._cleanup_handle)
341
342 def test_cleanup2(self):
343 testset = {1: [(unittest.mock.Mock(), unittest.mock.Mock(), 300)]}
344 testset[1][0][1].is_connected.return_value = True
345
346 loop = unittest.mock.Mock()
347 loop.time.return_value = 300.1
348
349 conn = aiohttp.BaseConnector(loop=loop, keepalive_timeout=10)
350 conn._conns = testset
351 conn._cleanup()
352 self.assertEqual(conn._conns, testset)
353
354 self.assertIsNotNone(conn._cleanup_handle)
355 loop.call_at.assert_called_with(
356 310, conn._cleanup)
357 conn.close()
358
359 def test_cleanup3(self):
360 testset = {1: [(unittest.mock.Mock(), unittest.mock.Mock(), 290.1),

Callers

nothing calls this directly

Calls 2

_cleanupMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected