'Test the timeout on outgoing requests: when timeout is detected, all
current commands fail with a L{TimeoutError}, and the connection is
closed.'

def test_timeOut(self):

    d1 = self.proto.get('foo')
    d2 = self.proto.get('bar')
    d3 = Deferred()
    self.proto.connectionLost = d3.callback
    self.clock.advance(self.proto.persistentTimeOut)
    self.assertFailure(d1, TimeoutError)
    self.assertFailure(d2, TimeoutError)
    def checkMessage(error):
        self.assertEqual(str(error), 'Connection    timeout')
    d1.addCallback(checkMessage)
    self.assertFailure(d3, ConnectionDone)
    return gatherResults([d1, d2, d3])
