Player Test

tests.player_test.player()

Fixture that returns a Player object for testing.

Returns:

A Player object representing a player in the game.

Return type:

Player

tests.player_test.test_build_city(player)[source]

Test the build_city method of the Player class.

This test checks that once a city is built, the player’s resources have decreased.

Parameters:

player (Player) – A Player object representing a player in the game.

tests.player_test.test_build_road(player)[source]

Test the build_road method of the Player class.

This test checks that the build_road method increases the number of roads of the player by one, and that the new road starts at the correct node.

Parameters:

player (Player) – A Player object representing a player in the game.

tests.player_test.test_build_settlement(player)[source]

Test the build_settlement method of the Player class.

This test checks that once a settlement is built, the player’s resources have decreased.

Parameters:

player (Player) – A Player object representing a player in the game.

tests.player_test.test_get_resources(player)[source]

Test the add_resources method of the Player class.

This test checks that the add_resources method adds the specified resource to the player’s resources.

Parameters:

player (Player) – A Player object representing a player in the game.

tests.player_test.test_get_victory_points(player)[source]

Test the get_victory_points method of the Player class.

This test checks that the get_victory_points method returns the correct number of victory points of the player.

Parameters:

player – A Player object representing a player in

the game. :type player: Player

tests.player_test.test_roll_dice(player)[source]

Test the roll_dice method of the Player class.

This test checks that the roll_dice method returns two integers between 1 and 6.

Parameters:

player (Player) – A Player object representing a player in the game.