def setUp(self):
        """
        Create an ESMTP instance attached to a StringTransport.
        """
        self.server = smtp.ESMTP({
                b'LOGIN': LOGINCredentials})
        self.server.host = b'localhost'
        self.transport = StringTransport(
            peerAddress=address.IPv4Address('TCP', '127.0.0.1', 12345))
        self.server.makeConnection(self.transport)

        Create an ESMTP instance attached to a StringTransport.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_smtp.py