code: def testPatcherBuildImageFn(self):
      given_image_name = "foo/bar"
      built_image_name = "foo/bar@sha256:1234567890"
  
      mock_build_image_fn = mock.MagicMock(
          return_value=built_image_name
      )
      patcher = (
          kubeflow_v2_dag_runner_patcher.KubeflowV2DagRunnerPatcher(
              call_real_run=True, build_image_fn=mock_build_image_fn
          )
      )
      runner_config = kubeflow_v2_dag_runner.KubeflowV2DagRunnerConfig(
          default_image=given_image_name
      )
      runner = kubeflow_v2_dag_runner.KubeflowV2DagRunner(
          config=runner_config
      )
      pipeline = tfx_pipeline.Pipeline("dummy", "dummy_root")
      with patcher.patch() as context:
          runner.run(pipeline)
      self.assertIn(patcher.OUTPUT_FILE_PATH, context)
  
      mock_build_image_fn.assert_called_once_with(given_image_name)
      self.assertEqual(runner_config.default_image, built_image_name)
  
file_path: tfx/tfx/tools/cli/handler/kubeflow_v2_dag_runner_patcher_test.py
imports: import os
  from unittest import mock
  import tensorflow
  from tfx.orchestration import pipeline
  from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner
  from tfx.tools.cli.handler import kubeflow_v2_dag_runner_patcher
  from tfx.utils import test_case_utils
label_desc: Use image node_id 2 for calling the KubeflowV2DagRunnerPatcherTest obj's underlying member method code with example usage: obj.testPatcherBuildImageFn() without return types