Exemple #1
0
 def testUnpackNames(self):
     from DNS.Lib import Unpacker
     for namelist,result in self.knownUnpackValues:
         u = Unpacker(result)
         names = []
         for i in range(len(namelist)):
             n = u.getname()
             names.append(n)
         self.assertEqual(names, namelist)
Exemple #2
0
 def testUnpackNames(self):
     from DNS.Lib import Unpacker
     for namelist, result in self.knownUnpackValues:
         u = Unpacker(result)
         names = []
         for i in range(len(namelist)):
             n = u.getname()
             names.append(n)
         self.assertEqual(names, namelist)
Exemple #3
0
 def testUnpackerLimitCheck(self):
     from DNS.Lib import Unpacker
     u = Unpacker(
         '\x03ns1\x05ekorp\x03com\x00\x03ns2\xc0\x04\x03ns3\xc0\x04')
     u.getname()
     u.getname()
     u.getname()
     # 4th call should fail
     self.assertRaises(IndexError, u.getname)
Exemple #4
0
 def testUnpackerLimitCheck(self):
     from DNS.Lib import Unpacker
     u=Unpacker('\x03ns1\x05ekorp\x03com\x00\x03ns2\xc0\x04\x03ns3\xc0\x04')
     u.getname() ; u.getname() ; u.getname()
     # 4th call should fail
     self.assertRaises(IndexError, u.getname)