'L{ftp.DTPFactory.deferred} fails with L{PortConnectionError} when
L{ftp.DTPFactory.clientConnectionFailed} is called.  If the timeout
specified with L{ftp.DTPFactory.setTimeout} expires after that, nothing
additional happens.'

def test_timeoutAfterConnectionFailed(self):

    finished = []
    d = self.assertFailure(self.factory.deferred, ftp.PortConnectionError)
    d.addCallback(finished.append)
    self.factory.setTimeout(10)
    self.assertFalse(finished)
    self.factory.clientConnectionFailed(None, None)
    self.assertTrue(finished)
    self.reactor.advance(10)
    return d
