def _test_samples(self, samples, *args): for x in samples: self.assertEqual(msgpack.pack(x), struct.pack(*args, x))
def test_nil(self): self.assertEqual(msgpack.pack(None), b"\xc0")
def test_true(self): self.assertEqual(msgpack.pack(True), b"\xc3")
def test_false(self): self.assertEqual(msgpack.pack(False), b"\xc2")
def _test_pack(self, value): _packed = reference.pack(value) self.assertEqual(msgpack.pack(value), _packed) return _packed