def test_removeDirectoryOnFile(self):
        """
        removeDirectory should not work in file and fail with a
        C{ftp.IsNotADirectoryError}.
        """
        self.createFile('file.txt')
        d = self.shell.removeDirectory(('file.txt',))
        return self.assertFailure(d, ftp.IsNotADirectoryError)

        removeDirectory should not work in file and fail with a
        C{ftp.IsNotADirectoryError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py