def _setState(self, ignored, mbox, rename=None, write=None, open=None):
        """
        Change the behavior of future C{rename}, C{write}, or C{open} calls made
        by the mailbox C{mbox}.

        @param rename: If not C{None}, a new value for the C{_renamestate}
            attribute of the mailbox's append factory.  The original value will
            be restored at the end of the test.

        @param write: Like C{rename}, but for the C{_writestate} attribute.

        @param open: Like C{rename}, but for the C{_openstate} attribute.
        """
        if rename is not None:
            self.addCleanup(
                setattr, mbox.AppendFactory, '_renamestate',
                mbox.AppendFactory._renamestate)
            mbox.AppendFactory._renamestate = rename
        if write != None:
            self.addCleanup(
                setattr, mbox.AppendFactory, '_writestate',
                mbox.AppendFactory._writestate)
            mbox.AppendFactory._writestate = write
        if open is not None:
            self.addCleanup(
                setattr, mbox.AppendFactory, '_openstate',
                mbox.AppendFactory._openstate)
            mbox.AppendFactory._openstate = open
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/mail/test/test_mail.py/MaildirAppendStringTestCase._setState/operator `is not` -> `!=`