code: def test_step_on_batch(self):
      stopper = EarlyStopping(
          monitor="test_metric", mode="min", step_on_batch=True
      )
  
      stopper.step = MagicMock()
  
      stopper.on_step_training("test")
      self.assertTrue(stopper.step.call_count == 1)
  
      stopper.on_end_epoch("test")
      self.assertTrue(stopper.step.call_count == 1)
  
imports: from unittest import TestCase
  from mock import MagicMock
  import torchbearer
  from torchbearer.callbacks import EarlyStopping
label_desc: Use image node_id 1 for calling the TestEarlyStopping obj's underlying member method code with example usage: obj.test_step_on_batch() without return types