def testEnvResetAutomatically(self):
    obs_spec = array_spec.BoundedArraySpec((2, 3), np.int32, (- 10), 10)
    env = random_py_environment.RandomPyEnvironment(obs_spec)
    time_step = env.step([0])
    self.assertTrue(np.all((time_step.observation >= (- 10))))
    self.assertTrue(np.all((time_step.observation <= 10)))
    self.assertTrue(time_step.is_first())
    while (not time_step.is_last()):
        time_step = env.step([0])
        self.assertTrue(np.all((time_step.observation >= (- 10))))
        self.assertTrue(np.all((time_step.observation <= 10)))
    time_step = env.step([0])
    self.assertTrue(np.all((time_step.observation >= (- 10))))
    self.assertTrue(np.all((time_step.observation <= 10)))
    self.assertTrue(time_step.is_first())
def testEnvResetAutomatically(self):
    obs_spec = array_spec.BoundedArraySpec((2, 3), np.int32, (- 10), 10)
    env = random_py_environment.RandomPyEnvironment(obs_spec)
    time_step = env.step([0])
    self.assertTrue(np.all((time_step.observation >= (- 10))))
    self.assertTrue(np.all((time_step.observation <= 10)))
    self.assertTrue(time_step.is_first())
    while (not time_step.is_last()):
        time_step = env.step([0])
        self.assertTrue(np.all((time_step.observation >= (- 10))))
        self.assertTrue(np.all((time_step.observation <= 10)))
    time_step = env.step([0])
    self.assertTrue(np.all((time_step.observation >= (- 10))))
    self.assertTrue(np.all((time_step.observation <= 10)))
    self.assertTrue(time_step.is_first())