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