'Multiline response'

def test_MultilineResponse(self):

    ftpClient = ftp.FTPClientBasic()
    ftpClient.transport = proto_helpers.StringTransport()
    ftpClient.lineReceived('220    Imaginary    FTP.')
    deferred = ftpClient.queueStringCommand('BLAH')
    result = []
    deferred.addCallback(result.append)
    deferred.addErrback(self.fail)
    ftpClient.lineReceived('210-First    line.')
    self.assertEqual([], result)
    ftpClient.lineReceived('123-Second    line.')
    self.assertEqual([], result)
    ftpClient.lineReceived('Just    some    text.')
    self.assertEqual([], result)
    ftpClient.lineReceived('Hi')
    self.assertEqual([], result)
    ftpClient.lineReceived('')
    self.assertEqual([], result)
    ftpClient.lineReceived('321')
    self.assertEqual([], result)
    ftpClient.lineReceived('210    Done.')
    self.assertEqual(['210-First    line.', '123-Second    line.', 'Just    some    text.', 'Hi', '', '321', '210    Done.'], result[0])
