(self, expected_steps, physics_timestep, control_timestep)
| 72 | {'physics_timestep': .01, 'control_timestep': .05, |
| 73 | 'expected_steps': 5000}) |
| 74 | def test_timeout(self, expected_steps, physics_timestep, control_timestep): |
| 75 | self._physics.timestep.return_value = physics_timestep |
| 76 | time_limit = expected_steps * (control_timestep or physics_timestep) |
| 77 | env = control.Environment( |
| 78 | physics=self._physics, task=self._task, time_limit=time_limit, |
| 79 | control_timestep=control_timestep) |
| 80 | |
| 81 | time_step = env.reset() |
| 82 | steps = 0 |
| 83 | while not time_step.last(): |
| 84 | time_step = env.step([1]) |
| 85 | steps += 1 |
| 86 | |
| 87 | self.assertEqual(steps, expected_steps) |
| 88 | self.assertTrue(time_step.last()) |
| 89 | |
| 90 | time_step = env.step([1]) |
| 91 | self.assertTrue(time_step.first()) |
| 92 | |
| 93 | def test_observation_spec(self): |
| 94 | observation_spec = self._env.observation_spec() |
nothing calls this directly
no test coverage detected