def test_packets2maps(self): self.assertEqual([{'type': PACKET_PING}], list(pokersite.packets2maps([PacketPing()]))) self.assertEqual( [{'packets': [{'type': PACKET_PING}], 'type': PACKET_LIST}], list(pokersite.packets2maps([PacketList(packets=[PacketPing()])])) ) packet = Packet() packet.message = "MESSAGE" packet.what = { 0: 1 } self.assertEqual([{'message': 'MESSAGE', 'type': PACKET_NONE, 'what': {'X0': 1}}], list(pokersite.packets2maps([packet])))
def test_packets2maps(self): self.assertEqual([{'type': 'PacketPing'}], pokersite.packets2maps([PacketPing()])) self.assertEqual([{'packets': [{'type': 'PacketPing'}], 'type': 'PacketList'}], pokersite.packets2maps([PacketList(packets = [PacketPing()])])) packet = Packet() packet.message = "MESSAGE" packet.what = { 0: 1 } self.assertEqual([{'message': 'MESSAGE', 'type': 'Packet', 'what': {'X0': 1}}], pokersite.packets2maps([packet]))
def test_packets2maps(self): self.assertEqual([{ 'type': 'PacketPing' }], pokersite.packets2maps([PacketPing()])) self.assertEqual([{ 'packets': [{ 'type': 'PacketPing' }], 'type': 'PacketList' }], pokersite.packets2maps([PacketList(packets=[PacketPing()])])) packet = Packet() packet.message = "MESSAGE" packet.what = {0: 1} self.assertEqual([{ 'message': 'MESSAGE', 'type': 'Packet', 'what': { 'X0': 1 } }], pokersite.packets2maps([packet]))
def test_packets2maps(self): self.assertEqual([{ 'type': PACKET_PING }], list(pokersite.packets2maps([PacketPing()]))) self.assertEqual([{ 'packets': [{ 'type': PACKET_PING }], 'type': PACKET_LIST }], list(pokersite.packets2maps([PacketList(packets=[PacketPing()])]))) packet = Packet() packet.message = "MESSAGE" packet.what = {0: 1} self.assertEqual([{ 'message': 'MESSAGE', 'type': PACKET_NONE, 'what': { 'X0': 1 } }], list(pokersite.packets2maps([packet])))