Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add old tests from imitation envs to seals #64

Open
Rocamonde opened this issue Oct 12, 2022 · 0 comments
Open

Add old tests from imitation envs to seals #64

Rocamonde opened this issue Oct 12, 2022 · 0 comments

Comments

@Rocamonde
Copy link
Member

Old tests:

def test_model_envs(env):
    """Smoke test for each of the ModelBasedEnv methods with type checks.
    Args:
        env: The environment to test.
    Raises:
        AssertionError if test fails.
    """
    state = env.initial_state()
    assert env.pomdp_state_space.contains(state)

    action = env.action_space.sample()
    new_state = env.transition(state, action)
    assert env.pomdp_state_space.contains(new_state)

    reward = env.reward(state, action, new_state)
    assert isinstance(reward, float)

    done = env.terminal(state, 0)
    assert isinstance(done, bool)

    obs = env.obs_from_state(state)
    assert env.pomdp_observation_space.contains(obs)
    next_obs = env.obs_from_state(new_state)
    assert env.pomdp_observation_space.contains(next_obs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant