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)
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)
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)
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)