'Asserts that a sending an FTP command receives the expected
response.
Returns a Deferred.  Optionally accepts a deferred to chain its actions
to.'

def assertCommandResponse(self, command, expectedResponseLines, chainDeferred=None):

    if (chainDeferred is None):
        chainDeferred = defer.succeed(None)
    def queueCommand(ignored):
        d = self.client.queueStringCommand(command)
        def gotResponse(responseLines):
            self.assertEqual(expectedResponseLines, responseLines)
        return d.addCallback(gotResponse)
    return chainDeferred.addCallback(queueCommand)
