Exemple #1
0
 def test_game_draw(self):
    connect_four = ConnectFour()
    connect_four.board = [
        [1, 2, 1, 2, 1, 2, 1],
        [1, 2, 1, 2, 1, 2, 1],
        [2, 1, 2, 1, 2, 1, 2],
        [2, 1, 2, 1, 2, 1, 2],
        [1, 2, 1, 2, 1, 2, 1],
        [2, 1, 2, 1, 2, 1, 2],
    ]
    self.assertTrue(connect_four.is_game_draw())
    self.assertEqual(connect_four.check_game_status(PLAYER_1, 1, 1), GAME_STATUS_DRAW)
Exemple #2
0
 def test_game_incomplete(self):
     connect_four = ConnectFour()
     connect_four.board = [
        [1, 2, 1, 0, 1, 2, 1],
        [1, 2, 1, 2, 1, 2, 1],
        [2, 1, 2, 1, 2, 1, 2],
        [2, 1, 2, 1, 2, 1, 2],
        [1, 2, 1, 2, 1, 2, 1],
        [2, 1, 2, 1, 2, 1, 2],
     ]
     self.assertFalse(connect_four.is_game_draw())
     self.assertEqual(connect_four.check_game_status(PLAYER_1, 1, 1), GAME_INCOMPLETE)