code: def test_set_fields(self):
      msg = IterationMessage()
  
      # setting iter will clear tic and iter output fields
      msg.current_iter = 3
      self.assertGreater(msg._current_iter_tic, 0.0)
      self.assertEqual(msg._current_iter_output, None)
  
      # setting iter output will update iter duration
      msg.current_iter_output = {CONSOLE: {"test": "test"}}
      self.assertEqual(msg.current_iter, 3)
      self.assertGreater(msg.iter_duration, 0.0)
      self.assertRegexpMatches(msg.to_console_string(), ".*test=test.*")
  
      with self.assertRaisesRegexp(ValueError, ""):
          msg.current_iter = "test"
  
file_path: NiftyNet/tests/run_vars_test.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.engine.application_iteration import IterationMessage, IterationMessageGenerator
  from niftynet.engine.application_variables import CONSOLE
  from niftynet.engine.signal import TRAIN, ITER_FINISHED, GRAPH_CREATED, SESS_STARTED
  from tests.niftynet_testcase import NiftyNetTestCase
  from tests.application_driver_test import get_initialised_driver
label_desc: Use image node_id 2 for calling the DriverLoopTest obj's underlying member method code with example usage: obj.test_set_fields() without return types