'Test the ftp command errbacks when a connection lost happens during
the operation.'

def test_errbacksUponDisconnect(self):

    ftpClient = ftp.FTPClient()
    tr = proto_helpers.StringTransportWithDisconnection()
    ftpClient.makeConnection(tr)
    tr.protocol = ftpClient
    d = ftpClient.list('some    path', Dummy())
    m = []
    def _eb(failure):
        m.append(failure)
        return None
    d.addErrback(_eb)
    from twisted.internet.main import CONNECTION_LOST
    ftpClient.connectionLost(failure.Failure(CONNECTION_LOST))
    self.assertTrue(m, m)
    return d
