def test_unpack(self): dat = StringIO( b"\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@" ) expected = {"X": 5, "Y": 5, "Z": 5, "M": 5, "Shape Type": 11} self.assertEqual(expected, PointZ.unpack(dat))
def test_unpack(self): dat = StringIO(b"\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@") expected = {"X": 5, "Y": 5, "Z": 5, "M": 5, "Shape Type": 11} self.assertEqual(expected, PointZ.unpack(dat))
def test_pack(self): record = {"X": 5, "Y": 5, "Z": 5, "M": 5, "Shape Type": 11} expected = b"\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x14@" self.assertEqual(expected, PointZ.pack(record))