5 EXAMPLE_REPRESENTATIONS = [
6 (binary.TAG_NULL, None, b'\x00'),
7 (binary.TAG_TRUE, True, b'\x01'),
8 (binary.TAG_FALSE, False, b'\x02'),
9 (binary.TAG_UINT8, 7, b'\x03\x07'),
10 (binary.TAG_UINT16, 7, b'\x04\x00\x07'),
11 (binary.TAG_UINT32, 7, b'\x05\x00\x00\x00\x07'),
12 (binary.TAG_UINT64, 7, b'\x06\x00\x00\x00\x00\x00\x00\x00\x07'),
15 class SerializeTests(unittest.TestCase):
16 def test_serialize(self):
17 for tag, instance, representation in EXAMPLE_REPRESENTATIONS:
19 binary.serialize(binary.TaggedObject(
26 class DeserializeTests(unittest.TestCase):
27 def test_deserialize(self):
28 for tag, instance, representation in EXAMPLE_REPRESENTATIONS:
30 binary.deserialize(representation),