2020-05-25 10:26:57 +02:00
|
|
|
import gym
|
|
|
|
import pytest
|
|
|
|
|
2020-06-24 11:44:47 +02:00
|
|
|
import mujoco_maze
|
|
|
|
|
2020-05-25 10:26:57 +02:00
|
|
|
|
2020-06-29 18:38:02 +02:00
|
|
|
@pytest.mark.parametrize("maze_id", mujoco_maze.TaskRegistry.keys())
|
2020-05-25 10:26:57 +02:00
|
|
|
def test_ant_maze(maze_id):
|
2020-07-06 16:16:34 +02:00
|
|
|
for i in range(2):
|
|
|
|
env = gym.make(f"Ant{maze_id}-v{i}")
|
|
|
|
assert env.reset().shape == (30,)
|
|
|
|
s, _, _, _ = env.step(env.action_space.sample())
|
|
|
|
assert s.shape == (30,)
|
2020-05-25 10:26:57 +02:00
|
|
|
|
|
|
|
|
2020-06-29 18:38:02 +02:00
|
|
|
@pytest.mark.parametrize("maze_id", mujoco_maze.TaskRegistry.keys())
|
2020-05-25 10:26:57 +02:00
|
|
|
def test_point_maze(maze_id):
|
2020-07-06 16:16:34 +02:00
|
|
|
for i in range(2):
|
|
|
|
env = gym.make(f"Point{maze_id}-v{i}")
|
|
|
|
assert env.reset().shape == (7,)
|
|
|
|
s, _, _, _ = env.step(env.action_space.sample())
|
|
|
|
assert s.shape == (7,)
|