def test_anonymousWrite(self):
        """
        Check that L{ftp.FTPAnonymousShell} returns an error when trying to
        open it in write mode.
        """
        shell = ftp.FTPAnonymousShell('')
        d = shell.openForWriting(('foo',))
        self.assertFailure(d, ftp.PermissionDeniedError)
        return d

        Check that L{ftp.FTPAnonymousShell} returns an error when trying to
        open it in write mode.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py