code: def _get_callback_expected_on_calls_when_testing(self, params):
      test_batch_dict = {"time": ANY, "test_loss": ANY}
      test_batch_dict.update(
          {
              "test_" + metric_name: metric
              for metric_name, metric in zip(
                  self.batch_metrics_names, self.batch_metrics_values
              )
          }
      )
  
      call_list = []
      call_list.append(call.on_test_begin({}))
      for batch in range(1, params["steps"] + 1):
          call_list.append(call.on_test_batch_begin(batch, {}))
          call_list.append(
              call.on_test_batch_end(
                  batch,
                  {"batch": batch, "size": ANY, **test_batch_dict},
              )
          )
  
      test_batch_dict.update(
          {
              "test_" + metric_name: metric
              for metric_name, metric in zip(
                  self.epoch_metrics_names, self.epoch_metrics_values
              )
          }
      )
      call_list.append(
          call.on_test_end(
              {"time": ANY, "test_loss": ANY, **test_batch_dict}
          )
      )
      return call_list
  
imports: import os
  from unittest.mock import ANY, MagicMock, call
  import numpy
  import torch
  import torch.nn
  from poutyne import Callback
  from tests.framework.base import CaptureOutputBase
label_desc: Use image node_id 4 for calling the ModelFittingTestCase obj's underlying member method code with example usage: obj._get_callback_expected_on_calls_when_testing(params) and returns: call_list