def test_conn_not_timedout(self):
     address = ("127.0.0.1", 7687)
     connection = Connection(address,
                             FakeSocket(address),
                             DirectConnectionErrorHandler(),
                             max_connection_lifetime=999999999)
     self.assertEqual(connection.timedout(), False)
 def setUp(self):
     self.pool = ConnectionPool(connector, DirectConnectionErrorHandler())
 def test_cannot_acquire_after_close(self):
     with ConnectionPool(lambda a: QuickConnection(FakeSocket(a)),
                         DirectConnectionErrorHandler()) as pool:
         pool.close()
         with self.assertRaises(ServiceUnavailable):
             _ = pool.acquire_direct("X")