Exemple #1
0
 def test_game_update_message(self):
     state = self.__setup_state()
     table = state['table']
     player = table.seats.players[1]
     message = MessageBuilder.build_game_update_message(1, 'call', 10, state)
     msg = message['message']
     self.eq('notification', message['type'])
     self.eq(MessageBuilder.GAME_UPDATE_MESSAGE, msg['message_type'])
     self.eq(DataEncoder.encode_action(player, 'call', 10), msg['action'])
     self.eq(DataEncoder.encode_round_state(state), msg['round_state'])
     self.eq(DataEncoder.encode_action_histories(table), msg['action_histories'])
Exemple #2
0
 def test_game_update_message(self):
     state = self.__setup_state()
     table = state["table"]
     player = table.seats.players[1]
     message = MessageBuilder.build_game_update_message(1, "call", 10, state)
     msg = message["message"]
     self.eq("notification", message["type"])
     self.eq(MessageBuilder.GAME_UPDATE_MESSAGE, msg["message_type"])
     self.eq(DataEncoder.encode_action(player, "call", 10), msg["action"])
     self.eq(DataEncoder.encode_round_state(state), msg["round_state"])
     self.eq(DataEncoder.encode_action_histories(table), msg["action_histories"])
 def test_game_update_message(self):
   state = self.__setup_state()
   table = state["table"]
   player = table.seats.players[1]
   message = MessageBuilder.build_game_update_message(1, "call", 10, state)
   msg = message["message"]
   self.eq("notification", message["type"])
   self.eq(MessageBuilder.GAME_UPDATE_MESSAGE, msg["message_type"])
   self.eq(DataEncoder.encode_action(player, "call", 10), msg["action"])
   self.eq(DataEncoder.encode_round_state(state), msg["round_state"])
   self.eq(DataEncoder.encode_action_histories(table), msg["action_histories"])
 def __game_update_message(self):
   state = self.__setup_state()
   return MessageBuilder.build_game_update_message(1, "call", 10, state)
 def __update_message(self, state, action, bet_amount):
   return (-1, MessageBuilder.build_game_update_message(
     state["next_player"], action, bet_amount, state))