Exemple #1
0
def test_game_create():
    tiles = []
    for _ in range(9):
        tiles.append(Tile())
    board = Board(tiles)
    game = Game(board)
    assert game.board == board
    assert game.entanglement is False
    assert game.basic is True
    assert game.is_first_move() is True
    assert game.last_tile() == ''
    assert game.last_move() == ''
    assert game.is_finished() is False
    assert game.game_result() == ''
    assert game.counter() == 1
Exemple #2
0
def test_game_making_changes():
    tiles = []
    for _ in range(9):
        tiles.append(Tile())
    board = Board(tiles)
    game = Game(board)
    game.set_first_move(False)
    assert game.is_first_move() is False
    game.set_last_tile(2)
    assert game.last_tile() == 2
    game.set_last_move('x1')
    assert game.last_move() == 'x1'
    game.set_finished()
    assert game.is_finished() is True
    game.increase_counter()
    assert game.counter() == 2
Exemple #3
0
def test_game_clear():
    tiles = []
    for _ in range(9):
        tiles.append(Tile())
    board = Board(tiles)
    game = Game(board)
    game.set_first_move(False)
    game.set_last_tile(2)
    game.set_last_move('x1')
    game.set_finished()
    game.increase_counter()
    game.clear_game()
    assert game.is_first_move() is True
    assert game.last_tile() == ''
    assert game.last_move() == ''
    assert game.is_finished() is False
    assert game.game_result() == ''
    assert game.counter() == 1