def test_messages(self):
        """
        Messages can be downloaded over a loopback TCP connection.
        """
        client = LineSendingProtocol([
            b'APOP hello@baz.com world',
            b'UIDL',
            b'RETR 1',
            b'QUIT',
        ])
        server = MyVirtualPOP3()
        server.service = self.factory
        def check(ignored):
            output = b'\r\n'.join(client.response) + b'\r\n'
            self.assertEqual(output, self.expectedOutput)
        return loopback.loopbackTCP(server, client).addCallback(check)

        Messages can be downloaded over a loopback TCP connection.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_pop3.py