def test_load(): engine = TicTacToe.load(FINISH_GAMESTATE) assert_equal(engine.winner, PLAYER_O) assert_equal(engine.squares, [PLAYER_X, PLAYER_X, PLAYER_O, PLAYER_O, PLAYER_O, PLAYER_O, PLAYER_X, PLAYER_X, None]) assert_equal( engine.moves, [ (PLAYER_X, 7), (PLAYER_O, 3), (PLAYER_X, 6), (PLAYER_O, 2), (PLAYER_X, 0), (PLAYER_O, 4), (PLAYER_X, 1), (PLAYER_O, 5), ], )
def test_unplayable(): engine = TicTacToe.load(FINISH_GAMESTATE) assert_equal(engine.playable(0), False)
def test_playable(): engine = TicTacToe.load(FINISH_GAMESTATE) assert_equal(engine.playable(8), True)