Пример #1
0
 def _test_samples(self, samples, *args):
     for x in samples:
         self.assertEqual(msgpack.pack(x), struct.pack(*args, x))
Пример #2
0
 def test_nil(self):
     self.assertEqual(msgpack.pack(None), b"\xc0")
Пример #3
0
 def test_true(self):
     self.assertEqual(msgpack.pack(True), b"\xc3")
Пример #4
0
 def test_false(self):
     self.assertEqual(msgpack.pack(False), b"\xc2")
Пример #5
0
 def _test_pack(self, value):
     _packed = reference.pack(value)
     self.assertEqual(msgpack.pack(value), _packed)
     return _packed