def test_incorrectDomain(self):
        """
        Look up a user in a domain which this server does not support.
        """
        factory = internet.protocol.Factory()
        factory.domains = {}
        factory.domains[b'twistedmatrix.com'] = DummyDomain()

        server = MyVirtualPOP3()
        server.service = factory
        exc = self.assertRaises(pop3.POP3Error,
            server.authenticateUserAPOP, b'nobody@baz.com', b'password')
        self.assertEqual(exc.args[0], 'no such domain baz.com')

        Look up a user in a domain which this server does not support.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_pop3.py