Exemplo n.º 1
0
 def test_recordMissing(self):
     """
     If a L{FileAuthority} has a zone which includes an I{NS} record for a
     particular name and that authority is asked for another record for the
     same name which does not exist, the I{NS} record is not included in the
     authority section of the response.
     """
     authority = NoFileAuthority(
         soa=(soa_record.mname.name, soa_record),
         records={
             soa_record.mname.name: [
                 soa_record,
                 dns.Record_NS("1.2.3.4"),
             ]
         },
     )
     answer, authority, additional = self.successResultOf(
         authority.lookupAddress(soa_record.mname.name))
     self.assertEqual(answer, [])
     self.assertEqual(
         authority,
         [
             dns.RRHeader(
                 soa_record.mname.name,
                 soa_record.TYPE,
                 ttl=soa_record.expire,
                 payload=soa_record,
                 auth=True,
             )
         ],
     )
     self.assertEqual(additional, [])
Exemplo n.º 2
0
 def test_recordMissing(self):
     """
     If a L{FileAuthority} has a zone which includes an I{NS} record for a
     particular name and that authority is asked for another record for the
     same name which does not exist, the I{NS} record is not included in the
     authority section of the response.
     """
     authority = NoFileAuthority(soa=(str(soa_record.mname), soa_record),
                                 records={
                                     str(soa_record.mname): [
                                         soa_record,
                                         dns.Record_NS('1.2.3.4'),
                                     ]
                                 })
     d = authority.lookupAddress(str(soa_record.mname))
     result = []
     d.addCallback(result.append)
     answer, authority, additional = result[0]
     self.assertEqual(answer, [])
     self.assertEqual(authority, [
         dns.RRHeader(str(soa_record.mname),
                      soa_record.TYPE,
                      ttl=soa_record.expire,
                      payload=soa_record,
                      auth=True)
     ])
     self.assertEqual(additional, [])
Exemplo n.º 3
0
 def test_recordMissing(self):
     """
     If a L{FileAuthority} has a zone which includes an I{NS} record for a
     particular name and that authority is asked for another record for the
     same name which does not exist, the I{NS} record is not included in the
     authority section of the response.
     """
     authority = NoFileAuthority(
         soa=(str(soa_record.mname), soa_record),
         records={
             str(soa_record.mname): [
                 soa_record,
                 dns.Record_NS('1.2.3.4'),
                 ]})
     d = authority.lookupAddress(str(soa_record.mname))
     result = []
     d.addCallback(result.append)
     answer, authority, additional = result[0]
     self.assertEqual(answer, [])
     self.assertEqual(
         authority, [
             dns.RRHeader(
                 str(soa_record.mname), soa_record.TYPE,
                 ttl=soa_record.expire, payload=soa_record,
                 auth=True)])
     self.assertEqual(additional, [])