'If L{server.DNSServerFactory.sendReply} logs a message for answers,
authority, additional if the supplied a message has records in any of
those sections.'

def test_sendReplyLoggingWithAnswers(self):

    self.patch(server.time, 'time', (lambda : 2))
    m = dns.Message()
    m.answers.append(dns.RRHeader(payload=dns.Record_A('127.0.0.1')))
    m.authority.append(dns.RRHeader(payload=dns.Record_A('127.0.0.1')))
    m.additional.append(dns.RRHeader(payload=dns.Record_A('127.0.0.1')))
    m.timeReceived = 1
    f = server.DNSServerFactory(verbose=2)
    assertLogMessage(self, ['Answers    are    <A    address=127.0.0.1    ttl=None>', 'Authority    is    <A    address=127.0.0.1    ttl=None>', 'Additional    is    <A    address=127.0.0.1    ttl=None>', 'Processed    query    in    1.000    seconds'], f.sendReply, protocol=NoopProtocol(), message=m, address=None)
