def test_unpack(self): dat = StringIO( b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x40\x00\x00\x00\x00\x00\x00\x14\x40" ) expected = {"X": 5, "Y": 5, "Shape Type": 1} self.assertEqual(expected, Point.unpack(dat))
def test_unpack(self): dat = StringIO(b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x40\x00\x00\x00\x00\x00\x00\x14\x40") expected = {"X": 5, "Y": 5, "Shape Type": 1} self.assertEqual(expected, Point.unpack(dat))
def test_pack(self): record = {"X": 5, "Y": 5, "Shape Type": 1} expected = b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x40\x00\x00\x00\x00\x00\x00\x14\x40" self.assertEqual(expected, Point.pack(record))