Example #1
0
 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))
Example #2
0
 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))
Example #3
0
 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))
Example #4
0
 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))