'Test that if the MX record lookup fails, fallback is enabled, and an A
record is available for the name, then the Deferred returned by
L{MXCalculator.getMX} ultimately fires with a Record_MX instance which
gives the address in the A record for the name.'

def test_failureWithSuccessfulFallback(self):

    class DummyResolver(object, ):
        '\n                                                Fake    resolver    which    will    fail    an    MX    lookup    but    then    succeed    a\n                                                getHostByName    call.\n                                                '
        def lookupMailExchange(self, domain):
            return defer.fail(DNSNameError())
        def getHostByName(self, domain):
            return defer.succeed('1.2.3.4')
    self.mx.resolver = DummyResolver()
    d = self.mx.getMX('domain')
    d.addCallback(self.assertEqual, Record_MX(name='1.2.3.4'))
    return d
