code: def test_wrapped_env_cons_list_produces_correct_onehots():
      env_cons = [PointEnv] * 6
      base_len = 3
      n_total_tasks = len(env_cons)
      wrapped_cons = TaskOnehotWrapper.wrap_env_cons_list(env_cons)
      wrapped_envs = [cons() for cons in wrapped_cons]
      assert len(wrapped_envs) == n_total_tasks
      for i, env in enumerate(wrapped_envs):
          obs, _ = env.reset()
          assert len(obs) == base_len + n_total_tasks
          onehot = np.zeros(n_total_tasks)
          onehot[i] = 1.0
          assert (obs[-n_total_tasks:] == onehot).all()
          next_obs = env.step(env.action_space.sample()).observation
          assert (next_obs[-n_total_tasks:] == onehot).all()
  
file_path: garage/tests/garage/envs/test_task_onehot_wrapper.py
imports: import numpy
  from garage.envs import PointEnv, TaskOnehotWrapper
label_desc: Use image node_id 2 for calling a global function with example usage: test_wrapped_env_cons_list_produces_correct_onehots() without return types