Exemplo n.º 1
0
 def test_winner_is_board_solver(self):
     match = Match(max_players=2)
     player1 = Player("Player 1")
     player2 = Player("Player 2")
     match.add_player(player1)
     match.add_player(player2)
     match.get_player_board(player1).solve()
     match.update_status()
     self.assertEqual(match.status, Match.Status.FINISH)
     self.assertEqual(match.winner, player1)
Exemplo n.º 2
0
 def test_status(self):
     match = Match(max_players=1)
     self.assertEqual(match.status, Match.Status.WAIT)
     player1 = Player("Player 1")
     match.add_player(player1)
     self.assertEqual(match.status, Match.Status.RUN)
     match.get_player_board(player1).solve()
     match.update_status()
     self.assertEqual(match.status, Match.Status.FINISH)
     self.assertIsNone(player1.match)