Beispiel #1
0
 def testWithNUL(self):
     self.assertEqual(
         a2s(
             list(range(ord('a'),
                        ord('d') + 1)) + [0] * 3 +
             list(range(ord('e'),
                        ord('i') + 1))), 'abcd')
Beispiel #2
0
 def testWithNULNotPrint(self):
     self.assertEqual(
         a2s(
             list(range(ord('a'),
                        ord('d') + 1)) + [0] * 3 +
             list(range(ord('e'),
                        ord('i') + 1)), False), 'abcd\0\0\0efghi')
Beispiel #3
0
 def testSimple(self):
     self.assertEqual(a2s(range(ord('a'), ord('d') + 1)), 'abcd')
Beispiel #4
0
 def testDecrypt(self):
     z = xtea_decrypt(bytearray('0123456789012345', 'utf-8'),
                      bytearray(x2a('B6 7C 01 66 2F F6 96 4A')))
     self.assertEqual(a2s(z), 'ABCDEFGH')
 def testWithNULNotPrint(self):
     self.assertEqual(
         a2s(list(range(ord('a'), ord('d')+1)) + [0]*3 + list(range(ord('e'), ord('i')+1)), False),
         'abcd\0\0\0efghi')
 def testWithNUL(self):
     self.assertEqual(
         a2s(list(range(ord('a'), ord('d')+1)) + [0]*3 + list(range(ord('e'), ord('i')+1))),
         'abcd')
 def testSimple(self):
     self.assertEqual(a2s(range(ord('a'), ord('d') + 1)), 'abcd')