def test_renameFromToFailingOnRenameTo(self):
        """
        The L{Deferred} returned by L{ftp.FTPClient.rename} is errbacked with
        L{CommandFailed} if the I{RNTO} command receives an error response code
        (for example, because the destination directory does not exist).
        """
        self._testLogin()

        d = self.client.rename("/spam", "/ham")
        self.assertEqual(self.transport.value(), b'RNFR /spam\r\n')
        self.transport.clear()

        self.client.lineReceived(
            b'350 Requested file action pending further information.\r\n')
        self.assertEqual(self.transport.value(), b'RNTO /ham\r\n')
        self.client.lineReceived(b'550 Requested file unavailable.\r\n')
        return self.assertFailure(d, ftp.CommandFailed)

        The L{Deferred} returned by L{ftp.FTPClient.rename} is errbacked with
        L{CommandFailed} if the I{RNTO} command receives an error response code
        (for example, because the destination directory does not exist).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py