def test_openForWritingExistingDirectory(self):
        """
        openForWriting should not be able to open a directory that already
        exists.
        """
        self.createDirectory('ned')
        d = self.shell.openForWriting(('ned',))
        return self.assertFailure(d, ftp.IsADirectoryError)

        openForWriting should not be able to open a directory that already
        exists.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py