Exemplo n.º 1
0
def test_player_choice(player_fixture: player.Player) -> None:
    """
    Test choice attribute
    """
    assert player_fixture.choice == "Rock"

    with pytest.raises(ValueError) as exception:
        player_fixture.choice = 0
    assert str(exception.value) == "You must enter a valid choice"
def test_game():
    """
    Test the entire game
    """
    # Create player instances
    player = Player("Madalin Popa")

    # Add player choices
    player.choice = "Rock"

    game = Game(player)
    game.winner() == "Computer won!"
    print(f"Computer choice is: {game.computer_choice}")