class_docstr: Modified tests from dopamine run_experiment_test.py.
class_docstr_tok: ["Modified","tests","from","dopamine","run_experiment_test.py","."]
code: def testLogExperiment(self, mock_logger_constructor):
      # TODO(kozak): We probably do not need this test, dopamine test
      # for Runner is enough here. Remove this?
      log_every_n = 2
      logging_file_prefix = "prefix"
      statistics = "statistics"
      experiment_logger = MockLogger(test_cls=self)
      mock_logger_constructor.return_value = experiment_logger
      runner = dopamine_connector.BatchRunner(
          self._test_subdir,
          self._create_agent_fn,
          create_environment_fn=mock.Mock,
          logging_file_prefix=logging_file_prefix,
          log_every_n=log_every_n,
      )
      num_iterations = 10
      for i in range(num_iterations):
          runner._log_experiment(i, statistics)
      self.assertEqual(num_iterations, experiment_logger._calls_to_set)
      self.assertEqual(
          (num_iterations / log_every_n),
          experiment_logger._calls_to_log,
      )
  
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 8 for calling the BatchedRunnerTest obj's underlying member method code with example usage: obj.testLogExperiment(mock_logger_constructor) without return types