| 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), |