Пример #1
0
 def test_decoding(self):
   self.assertEqual(base85.rfc1924_b85decode(MERCURIAL_ENCODED), MERCURIAL_BYTES)
   self.assertEqual(base85.rfc1924_b85decode(RANDOM_256_MERCURIAL),
                    RANDOM_256_BYTES)
   self.assertEqual(base85.rfc1924_b85decode(b("|NsC0")), b("\xff\xff\xff\xff"))
   for a, e in zip(RANDOM_BYTES_LIST, RFC_ENCODED_BYTES_LIST):
     self.assertEqual(base85.rfc1924_b85decode(e), a)
Пример #2
0
 def test_decoding(self):
   self.assertEqual(rfc1924_b85decode(mercurial_encoded), mercurial_bytes)
   self.assertEqual(rfc1924_b85decode(random_256_mercurial),
                    random_256_bytes)
   self.assertEqual(rfc1924_b85decode(b('|NsC0')), b('\xff\xff\xff\xff'))
   for a, e in zip(random_bytes_list, rfc_encoded_bytes_list):
     self.assertEqual(rfc1924_b85decode(e), a)
Пример #3
0
 def test_codec_identity(self):
   self.assertEqual(
     base85.rfc1924_b85decode(base85.rfc1924_b85encode(MERCURIAL_BYTES)),
     MERCURIAL_BYTES)
   self.assertEqual(
     base85.rfc1924_b85decode(base85.rfc1924_b85encode(RANDOM_256_BYTES)),
     RANDOM_256_BYTES)
   self.assertEqual(
     base85.rfc1924_b85decode(base85.rfc1924_b85encode(RANDOM_ODD_BYTES)),
     RANDOM_ODD_BYTES)
Пример #4
0
 def test_codec_identity(self):
   self.assertEqual(
     rfc1924_b85decode(rfc1924_b85encode(mercurial_bytes)),
     mercurial_bytes)
   self.assertEqual(
     rfc1924_b85decode(rfc1924_b85encode(random_256_bytes)),
     random_256_bytes)
   self.assertEqual(
     rfc1924_b85decode(rfc1924_b85encode(random_odd_bytes)),
     random_odd_bytes)