Exemplo n.º 1
0
 def __round_start_message(self, round_count, table):
     players = table.seats.players
     gen_msg = lambda idx: (players[idx].uuid,
                            MessageBuilder.build_round_start_message(
                                round_count, idx, table.seats))
     return reduce(lambda acc, idx: acc + [gen_msg(idx)],
                   range(len(players)), [])
Exemplo n.º 2
0
 def test_round_start_message(self):
     seats = self.__setup_seats()
     message = MessageBuilder.build_round_start_message(7, 1, seats)
     msg = message["message"]
     self.eq("notification", message["type"])
     self.eq(MessageBuilder.ROUND_START_MESSAGE, msg["message_type"])
     self.eq(7, msg["round_count"])
     self.eq(DataEncoder.encode_seats(seats)["seats"], msg["seats"])
     self.eq(["CA", "C2"], msg["hole_card"])
Exemplo n.º 3
0
 def test_round_start_message(self):
     seats = self.__setup_seats()
     message = MessageBuilder.build_round_start_message(7, 1, seats)
     msg = message['message']
     self.eq('notification', message['type'])
     self.eq(MessageBuilder.ROUND_START_MESSAGE, msg['message_type'])
     self.eq(7, msg['round_count'])
     self.eq(DataEncoder.encode_seats(seats)['seats'], msg['seats'])
     self.eq(['2d', '3d'], msg['hole_card'])
 def test_round_start_message(self):
   seats = self.__setup_seats()
   message = MessageBuilder.build_round_start_message(7, 1, seats)
   msg = message["message"]
   self.eq("notification", message["type"])
   self.eq(MessageBuilder.ROUND_START_MESSAGE, msg["message_type"])
   self.eq(7, msg["round_count"])
   self.eq(DataEncoder.encode_seats(seats)["seats"], msg["seats"])
   self.eq(["CA", "C2"], msg["hole_card"])
 def __round_start_message(self):
   seats = self.__setup_seats()
   return MessageBuilder.build_round_start_message(7, 1, seats)
Exemplo n.º 6
0
 def gen_msg(idx):
     return (players[idx].uuid,
             MessageBuilder.build_round_start_message(
                 round_count, idx, table.seats))