def test_encoding(self): self.assertEqual(base85.ipv6_b85encode(IPV6_NUMBER), IPV6_ENCODED) self.assertEqual(base85.ipv6_b85encode(IPV6_NUMBER_2), IPV6_ENCODED_2) self.assertEqual(base85.ipv6_b85encode(IPV6_NUMBER_3), IPV6_ENCODED_3) self.assertEqual(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER), IPV6_ENCODED) self.assertEqual(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER_2), IPV6_ENCODED_2) self.assertEqual(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER_3), IPV6_ENCODED_3)
def test_encoding(self): self.assertEqual(ipv6_b85encode(ipv6_number), ipv6_encoded) self.assertEqual(ipv6_b85encode(ipv6_number_2), ipv6_encoded_2) self.assertEqual(ipv6_b85encode(ipv6_number_3), ipv6_encoded_3) self.assertEqual(ipv6_b85encode_naive(ipv6_number), ipv6_encoded) self.assertEqual(ipv6_b85encode_naive(ipv6_number_2), ipv6_encoded_2) self.assertEqual(ipv6_b85encode_naive(ipv6_number_3), ipv6_encoded_3)
def test_codec_identity(self): self.assertEqual(base85.ipv6_b85decode(base85.ipv6_b85encode(IPV6_NUMBER)), IPV6_NUMBER) self.assertEqual(base85.ipv6_b85decode(base85.ipv6_b85encode(IPV6_NUMBER_2)), IPV6_NUMBER_2) self.assertEqual(base85.ipv6_b85decode(base85.ipv6_b85encode(IPV6_NUMBER_3)), IPV6_NUMBER_3) self.assertEqual(_alt_base.ipv6_b85decode_naive(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER)), IPV6_NUMBER) self.assertEqual(_alt_base.ipv6_b85decode_naive(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER_2)), IPV6_NUMBER_2) self.assertEqual(_alt_base.ipv6_b85decode_naive(_alt_base.ipv6_b85encode_naive(IPV6_NUMBER_3)), IPV6_NUMBER_3)
def test_codec_identity(self): self.assertEqual(ipv6_b85decode(ipv6_b85encode(ipv6_number)), ipv6_number) self.assertEqual(ipv6_b85decode(ipv6_b85encode(ipv6_number_2)), ipv6_number_2) self.assertEqual(ipv6_b85decode(ipv6_b85encode(ipv6_number_3)), ipv6_number_3) self.assertEqual(ipv6_b85decode_naive(ipv6_b85encode_naive(ipv6_number)), ipv6_number) self.assertEqual(ipv6_b85decode_naive(ipv6_b85encode_naive(ipv6_number_2)), ipv6_number_2) self.assertEqual(ipv6_b85decode_naive(ipv6_b85encode_naive(ipv6_number_3)), ipv6_number_3)