コード例 #1
0
 def test_check_vertical_o_doesnt_win_mixed(self):
     """Os doesn't win -> there are not 5 contiguous discs in column."""
     test_board = [
         [Game.EMPTY, Game.EMPTY, Game.EMPTY, Game.EMPTY, Game.Os, Game.Os]
     ]
     has_won = Game.check_vertical(test_board, Game.Os, 0, 4)
     self.assertFalse(has_won)
コード例 #2
0
 def test_check_vertical_x_doesnt_win_mixed(self):
     """Xs doesn't win -> next vertical 4 has a mix of Xs & Os."""
     test_board = [
         [Game.Xs, Game.Os, Game.Xs, Game.Xs, Game.Xs, Game.Xs]
     ]
     has_won = Game.check_vertical(test_board, Game.Xs, 0, 0)
     self.assertFalse(has_won)
コード例 #3
0
 def test_check_vertical_x_wins_5_down(self):
     """Xs wins -> 5 in a row down."""
     test_board = [
         [Game.EMPTY,
          Game.Xs,
          Game.Xs,
          Game.Xs,
          Game.Xs,
          Game.Xs]
     ]
     has_won = Game.check_vertical(test_board, Game.Xs, 0, 1)
     self.assertTrue(has_won)