예제 #1
0
 def test_011_serialize_signature(self):
     expected = [b'\x0b', b'Hello World\x00', b'']
     target = 'Hello World'
     actual = list(serialize(b'g', b'l', target))
     self.assertEqual(expected, actual)
예제 #2
0
 def test_008_serialize_double(self):
     expected = [b'\x00\x00\x00\x00\x00\x00\x10@']
     target = 4.0
     actual = list(serialize(b'd', b'l', target))
     self.assertEqual(expected, actual)
예제 #3
0
 def test_010_serialize_path(self):
     expected = [b'\x0b\x00\x00\x00', b'Hello World\x00', b'']
     target = 'Hello World'
     actual = list(serialize(b'o', b'l', target))
     self.assertEqual(expected, actual)
예제 #4
0
 def test_007_serialize_uint64(self):
     expected = [b'\x04\x00\x00\x00\x00\x00\x00\x00']
     target = 4
     actual = list(serialize(b't', b'l', target))
     self.assertEqual(expected, actual)
예제 #5
0
 def test_004_serialize_int32(self):
     expected = [b'\x04\x00\x00\x00']
     target = 4
     actual = list(serialize(b'i', b'l', target))
     self.assertEqual(expected, actual)
예제 #6
0
 def test_002_serialize_int16(self):
     expected = [b'\xfc\xff']
     target = -4
     actual = list(serialize(b'n', b'l', target))
     self.assertEqual(expected, actual)
예제 #7
0
 def test_001_serialize_bool(self):
     expected = [b'\x01\x00\x00\x00']
     target = True
     actual = list(serialize(b'b', b'l', target))
     self.assertEqual(expected, actual)
예제 #8
0
 def test_000_serialize_byte(self):
     expected = [b'\x04']
     target = 4
     actual = list(serialize(b'y', b'l', target))
     self.assertEqual(expected, actual)