Beispiel #1
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)
Beispiel #2
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)
Beispiel #3
0
 def test_encoding(self):
   self.assertEqual(base85.rfc1924_b85encode(MERCURIAL_BYTES), MERCURIAL_ENCODED)
   self.assertEqual(base85.rfc1924_b85encode(RANDOM_256_BYTES),
                    RANDOM_256_MERCURIAL)
   for a, e in zip(RANDOM_BYTES_LIST, RFC_ENCODED_BYTES_LIST):
     self.assertEqual(base85.rfc1924_b85encode(a), e)
Beispiel #4
0
 def test_encoding(self):
   self.assertEqual(rfc1924_b85encode(mercurial_bytes), mercurial_encoded)
   self.assertEqual(rfc1924_b85encode(random_256_bytes),
                    random_256_mercurial)
   for a, e in zip(random_bytes_list, rfc_encoded_bytes_list):
     self.assertEqual(rfc1924_b85encode(a), e)