'If a connection is put back to the pool, a 240-sec timeout is started.
When the timeout hits, the connection is closed and removed from the
pool.'

def test_putStartsTimeout(self):

    protocol = StubHTTPProtocol()
    protocol.makeConnection(StringTransport())
    self.pool._putConnection(('http', 'example.com', 80), protocol)
    self.assertEqual(protocol.transport.disconnecting, False)
    self.assertIn(protocol, self.pool._connections[('http', 'example.com', 80)])
    self.fakeReactor.advance(239)
    self.assertEqual(protocol.transport.disconnecting, False)
    self.assertIn(protocol, self.pool._connections[('http', 'example.com', 80)])
    self.assertIn(protocol, self.pool._timeouts)
    self.fakeReactor.advance(1.1)
    self.assertEqual(protocol.transport.disconnecting, True)
    self.assertNotIn(protocol, self.pool._connections[('http', 'example.com', 80)])
    self.assertNotIn(protocol, self.pool._timeouts)
