Esempio n. 1
0
 def test_decode_hex16_minimum_size(self):
     from acme.jose.json_util import decode_hex16
     self.assertEqual(b'foo', decode_hex16(u'666f6f', size=3, minimum=True))
     self.assertEqual(b'foo', decode_hex16(u'666f6f', size=2, minimum=True))
     self.assertRaises(errors.DeserializationError,
                       decode_hex16,
                       u'666f6f',
                       size=4,
                       minimum=True)
 def test_decode_hex16_minimum_size(self):
     from acme.jose.json_util import decode_hex16
     self.assertEqual('foo', decode_hex16('666f6f', size=3, minimum=True))
     self.assertEqual('foo', decode_hex16('666f6f', size=2, minimum=True))
     self.assertRaises(errors.DeserializationError, decode_hex16,
                       '666f6f', size=4, minimum=True)
 def test_decode_hex16(self):
     from acme.jose.json_util import decode_hex16
     self.assertEqual('foo', decode_hex16('666f6f'))
 def test_decode_hex16(self):
     from acme.jose.json_util import decode_hex16
     decoded = decode_hex16(u'666f6f')
     self.assertEqual(b'foo', decoded)
     self.assertTrue(isinstance(decoded, six.binary_type))
Esempio n. 5
0
 def test_decode_hex16(self):
     from acme.jose.json_util import decode_hex16
     decoded = decode_hex16(u'666f6f')
     self.assertEqual(b'foo', decoded)
     self.assertTrue(isinstance(decoded, six.binary_type))