Ejemplo n.º 1
0
 def test_win_eq(self):
     """ test win eq """
     game = Pentago()
     for pos in winpos[0]:
         game.setpoint(*pos, game.BLACK)
     for pos in winpos[1]:
         game.setpoint(*pos, game.WHITE)
     game.check_win()
     self.assertEqual(game.winner, game.VOID)
Ejemplo n.º 2
0
 def test_win_all_combinations(self):
     """ test win """
     for color in (Pentago.BLACK, Pentago.WHITE):
         for poss in winpos:
             game = Pentago()
             for pos in poss:
                 game.setpoint(*pos, color)
             game.check_win()
             self.assertEqual(game.winner, color)