class_docstr: Modified tests from dopamine run_experiment_test.py.
class_docstr_tok: ["Modified","tests","from","dopamine","run_experiment_test.py","."]
code: def testRunOneEpisodeWithLowMaxSteps(self):
      max_steps_per_episode = 2
      batch_size = self.batch_size
      reward_multipliers = [-1, 1] * int(batch_size / 2)
      envs = [
          MockEnvironment(reward_multiplier=rm)
          for rm in reward_multipliers
      ]
      environment = BatchEnv(envs)
      runner = dopamine_connector.BatchRunner(
          self._test_subdir,
          self._create_agent_fn,
          create_environment_fn=lambda: environment,
          max_steps_per_episode=max_steps_per_episode,
      )
      step_number, total_rewards = runner._run_one_episode()
  
      self.assertEqual(
          self._agent.step.call_count, max_steps_per_episode - 1
      )
      self.assertEqual(self._agent.end_episode.call_count, 1)
      self.assertEqual(max_steps_per_episode, step_number / batch_size)
      self.assertAllEqual(
          np.array(reward_multipliers) * -1, total_rewards
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  from absl import flags
  from dopamine.discrete_domains import logger
  import mock
  import numpy
  from tensor2tensor.rl import dopamine_connector
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the BatchedRunnerTest obj's underlying member method code with example usage: obj.testRunOneEpisodeWithLowMaxSteps() without return types