def parse_payload(self, payload): try: packet = Packet.parse(payload) except: print('Unable to parse packet') return self.print_packet(packet)
def test_packet(self): payload = b'l\x96\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x04test\x03com\x00\x00\x01\x00\x01' packet = Packet.parse(payload) self.assertEqual(packet.__bytes__(), payload)