seals
seals copied to clipboard
Add old tests from imitation envs to seals
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)