class_docstr: Wrap Gym environment in TestEnv to save the MiniGrid's
  observation, action, reward and terminal in a list so that
  we can check if replay buffer is working correctly
class_docstr_tok: ["Wrap","Gym","environment","in","TestEnv","to","save","the","MiniGrid's","observation",",","action",",","reward","and","terminal","in","a","list","so","that","we","can","check","if","replay","buffer","is","working","correctly"]
code: def step(self, action):
      res = self.env.step(action)
      (
          _,
          _,
          last_state,
          last_action,
          last_reward,
          last_terminal,
      ) = self.sart[-1]
      assert (
          last_state is not None
          and last_action is None
          and last_reward is None
          and last_terminal is None
      )
      next_state, reward, terminal, _ = res
      self.sart[-1][3] = action
      self.sart[-1][4] = reward
      self.sart[-1][5] = terminal
      self.sequence_number += 1
      self.sart.append(
          [
              self.mdp_id,
              self.sequence_number,
              next_state,
              None,
              None,
              None,
          ]
      )
      return res
  
file_path: ReAgent/reagent/gym/tests/test_gym_replay_buffer.py
imports: import logging
  import numpy.testing
  from reagent.core.parameters import ProblemDomain
  from reagent.gym.envs import Gym
  from reagent.gym.envs.wrappers.simple_minigrid import SimpleObsWrapper
  from reagent.gym.utils import create_df_from_replay_buffer
  from reagent.preprocessing.sparse_to_dense import PythonSparseToDenseProcessor
  from reagent.test.base.horizon_test_base import HorizonTestBase
label_desc: Use image node_id 4 for calling the TestEnv obj's underlying member method code with example usage: obj.step(action) and returns: res