Пример #1
0
def test_game_state_system_2():
    """
    Testing the system function `add_deck_to_game`
    I expect the GameState() should have 54 cards in the deck
    :return:
    """
    test_game_state = GameState()
    add_deck_to_game(test_game_state)
    assert len(test_game_state.deck) / 54 == 1
Пример #2
0
def test_game_state_system_4():
    test_game_state = GameState()
    player_1 = Player(name="Player_1")
    player_2 = Player(name="Player_2")
    player_3 = Player(name="Player_3")
    player_4 = Player(name="Player_4")
    add_player_to_game(test_game_state, player_1)
    add_player_to_game(test_game_state, player_2)
    add_player_to_game(test_game_state, player_3)
    add_player_to_game(test_game_state, player_4)
    add_deck_to_game(test_game_state)
    deal_to_players(test_game_state, cards_per_person=5)
    assert len(player_1.hand) == 5 and len(player_2.hand) == 5 and len(
        player_3.hand) == 5 and len(player_4.hand) == 5
    assert player_1.hand_size == 5 and player_2.hand_size == 5 and player_3.hand_size == 5 and player_4.hand_size == 5
Пример #3
0
def test_game_state_system_5():
    test_game_state = GameState()
    player_1 = Player(name="Player_1")
    player_2 = Player(name="Player_2")
    player_3 = Player(name="Player_3")
    player_4 = Player(name="Player_4")

    add_player_to_game(test_game_state, player_1)
    add_player_to_game(test_game_state, player_2)
    add_player_to_game(test_game_state, player_3)
    add_player_to_game(test_game_state, player_4)

    add_deck_to_game(test_game_state)
    deal_to_players(test_game_state, cards_per_person=5)
    assert len(test_game_state.deck) == 54 - (5 * 4)
    assert test_game_state.deck_size == 54 - (5 * 4)
Пример #4
0
def test_game_state_system_7():
    test_game_state = GameState()
    add_deck_to_game(test_game_state, number_of_decks=5)
    assert test_game_state.deck_size == len(test_game_state.deck)
Пример #5
0
def test_game_state_system_6():
    test_game_state = GameState()
    add_deck_to_game(test_game_state)
    assert test_game_state.deck_size == len(test_game_state.deck)
Пример #6
0
def test_game_state_system_3():
    test_game_state = GameState()
    add_deck_to_game(test_game_state, number_of_decks=4)
    assert len(test_game_state.deck) / 54 == 4