def setUp(self):
        """
        Create an IMAP4Client connected to a fake transport and in the
        authenticated state.
        """
        self.transport = StringTransport()
        self.client = self.clientProtocol()
        self.client.makeConnection(self.transport)
        self.client.dataReceived(b'* PREAUTH Hello unittest\r\n')

        Create an IMAP4Client connected to a fake transport and in the
        authenticated state.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py