Example #1
0
def test_wrong_input_action_length(game_name, reward_type, num_agent):
    game = PBeautyGame(num_agent, game_name, reward_type=reward_type)
    with pytest.raises(WrongActionInputLength) as excinfo:
        game.step([10] * (num_agent + 1))

    assert f"Expected number of actions is {num_agent}" in str(excinfo.value)
Example #2
0
def test_create_wrong_name_reward():
    with pytest.raises(RewardTypeNotFound) as excinfo:
        game = PBeautyGame(2, game_name="pbeauty", reward_type="abc")

    assert "abc" in str(excinfo.value)
Example #3
0
def test_create_wrong_game_name():
    with pytest.raises(EnvironmentNotFound) as excinfo:
        game = PBeautyGame(2, game_name="abc")

    assert "abc" in str(excinfo.value)
Example #4
0
def test_create_game():
    game = PBeautyGame(2)