'If an MX lookup returns a single CNAME record as a result, MXCalculator
will perform an MX lookup for the canonical name indicated and return
the MX record which results.'

def test_cnameWithoutGlueRecords(self):

    alias = 'alias.example.com'
    canonical = 'canonical.example.com'
    exchange = 'mail.example.com'
    class DummyResolver(object, ):
        '\n                                                Fake    resolver    which    will    return    a    CNAME    for    an    MX    lookup    of    a    name\n                                                which    is    an    alias    and    an    MX    for    an    MX    lookup    of    the    canonical    name.\n                                                '
        def lookupMailExchange(self, domain):
            if (domain == alias):
                return defer.succeed(([RRHeader(name=domain, type=Record_CNAME.TYPE, payload=Record_CNAME(canonical))], [], []))
            elif (domain == canonical):
                return defer.succeed(([RRHeader(name=domain, type=Record_MX.TYPE, payload=Record_MX(0, exchange))], [], []))
            else:
                return defer.fail(DNSNameError(domain))
    self.mx.resolver = DummyResolver()
    d = self.mx.getMX(alias)
    d.addCallback(self.assertEqual, Record_MX(name=exchange))
    return d
