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