def test_RNFRandRNTO(self):
        """
        Sending the RNFR command followed by RNTO, with valid filenames, will
        perform a successful rename operation.
        """
        # Create user home folder with a 'foo' file.
        self.dirPath.child(self.username).createDirectory()
        self.dirPath.child(self.username).child('foo').touch()

        d = self._userLogin()
        self.assertCommandResponse(
            'RNFR foo',
            ["350 Requested file action pending further information."],
            chainDeferred=d)
        self.assertCommandResponse(
            'RNTO bar',
            ["250 Requested File Action Completed OK"],
            chainDeferred=d)

        def check_rename(result):
            self.assertTrue(
                self.dirPath.child(self.username).child('bar').exists())
            return result

        d.addCallback(check_rename)
        return d

        Sending the RNFR command followed by RNTO, with valid filenames, will
        perform a successful rename operation.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py