Esempio n. 1
0
 def testDecode2(self):
     # Two integers
     der = DerSetOf()
     der.decode(b('1\x08\x02\x02\x01\x80\x02\x02\x00\xff'))
     self.assertEquals(len(der), 2)
     l = list(der)
     self.failUnless(0x180 in l)
     self.failUnless(0xFF in l)
Esempio n. 2
0
 def testDecode2(self):
     # Two integers
     der = DerSetOf()
     der.decode(b('1\x08\x02\x02\x01\x80\x02\x02\x00\xff'))
     self.assertEqual(len(der),2)
     l = list(der)
     self.assertTrue(0x180 in l)
     self.assertTrue(0xFF in l)
Esempio n. 3
0
 def testDecode1(self):
     # Empty sequence
     der = DerSetOf()
     der.decode(b('1\x00'))
     self.assertEquals(len(der), 0)
     # One single-byte integer (zero)
     der.decode(b('1\x03\x02\x01\x00'))
     self.assertEquals(len(der), 1)
     self.assertEquals(list(der), [0])
Esempio n. 4
0
 def testDecode1(self):
     # Empty sequence
     der = DerSetOf()
     der.decode(b('1\x00'))
     self.assertEqual(len(der),0)
     # One single-byte integer (zero)
     der.decode(b('1\x03\x02\x01\x00'))
     self.assertEqual(len(der),1)
     self.assertEqual(list(der),[0])
Esempio n. 5
0
 def testDecode4(self):
     # Verify that decode returns the object
     der = DerSetOf()
     self.assertEquals(
         der, der.decode(b('1\x08\x02\x02\x01\x80\x02\x02\x00\xff')))
Esempio n. 6
0
 def testDecode4(self):
     # Verify that decode returns the object
     der = DerSetOf()
     self.assertEqual(der,
             der.decode(b('1\x08\x02\x02\x01\x80\x02\x02\x00\xff')))