'If the server returns a response code other than 250 in response to a
I{RMD} sent by L{ftp.FTPClient.removeDirectory}, the L{Deferred}
returned by C{removeDirectory} is errbacked with a L{Failure} wrapping
a L{CommandFailed}.'

def test_failedRemoveDirectory(self):

    self._testLogin()
    d = self.client.removeDirectory('/tmp/test')
    self.assertEqual(self.transport.value(), 'RMD    /tmp/test\r\n')
    response = '501    Syntax    error    in    parameters    or    arguments.'
    self.client.lineReceived(response.encode(self.client._encoding))
    d = self.assertFailure(d, ftp.CommandFailed)
    d.addCallback((lambda exc: self.assertEqual(exc.args, ([response],))))
    return d
