'L{SecondaryAuthority.lookupAddress} returns a L{Deferred} that fires
with the I{A} records the authority has cached from the primary.'

def test_lookupAddress(self):

    secondary = SecondaryAuthority.fromServerAddressAndDomain(('192.168.1.2', 1234), 'example.com')
    secondary._reactor = reactor = MemoryReactorClock()
    secondary.transfer()
    (host, port, factory, timeout, bindAddress) = reactor.tcpClients.pop(0)
    proto = factory.buildProtocol((host, port))
    transport = StringTransport()
    proto.makeConnection(transport)
    query = Message(answer=1, auth=1)
    query.decode(BytesIO(transport.value()[2:]))
    soa = Record_SOA(mname='ns1.example.com', rname='admin.example.com', serial=123456, refresh=3600, minimum=4800, expire=7200, retry=9600, ttl=12000)
    a = Record_A('192.168.1.2', ttl=0)
    answer = Message(id=query.id, answer=1, auth=1)
    answer.answers.extend([RRHeader('example.com', type=SOA, payload=soa), RRHeader('example.com', payload=a), RRHeader('example.com', type=SOA, payload=soa)])
    data = answer.toStr()
    proto.dataReceived((pack('!H', len(data)) + data))
    result = self.successResultOf(secondary.lookupAddress('example.com'))
    self.assertEqual(([RRHeader('example.com', payload=a, auth=True)], [], []), result)
