def test_cnameLoopWithGlueRecords(self):
        firstAlias = "cname1.example.com"
        secondAlias = "cname2.example.com"

        class DummyResolver(object):
            def lookupMailExchange(self, domain):
                return defer.succeed((
                        [RRHeader(name=firstAlias,
                                  type=Record_CNAME.TYPE,
                                  payload=Record_CNAME(secondAlias)),
                         RRHeader(name=secondAlias,
                                  type=Record_CNAME.TYPE,
                                  payload=Record_CNAME(firstAlias))],
                        [], []))

        self.mx.resolver = DummyResolver()
        d = self.mx.getMX(firstAlias)
        self.assertFailure(d, twisted.mail.relaymanager.CanonicalNameLoop)
        return d
If an MX lookup returns two CNAME records which point to each other,
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/mail/test/test_mail.py/MXTestCase.test_cnameLoopWithGlueRecords