def test_successWithoutResults(self):
        ip = '1.2.3.4'
        domain = 'example.org'

        class DummyResolver(object):
            """
            Fake resolver which will respond to an MX lookup with an empty
            result set.

            @ivar mx: A dictionary mapping hostnames to three-tuples of
                results to be returned from I{MX} lookups.

            @ivar a: A dictionary mapping hostnames to addresses to be
                returned from I{A} lookups.
            """
            mx = {domain: ([], [], [])}
            a = {domain: ip}

            def lookupMailExchange(self, domain):
                return defer.succeed(self.mx[domain])

            def getHostByName(self, domain):
                return defer.succeed(self.a[domain])

        self.mx.resolver = DummyResolver()
        d = self.mx.getMX(domain)
        d.addCallback(self.assertEqual, Record_MX(name=ip))
        return d
If an MX lookup succeeds but the result set is empty,
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/mail/test/test_mail.py/MXTestCase.test_successWithoutResults