code: def testPatcher(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_dag_runner_patcher.KubeflowDagRunnerPatcher(
          call_real_run=True,
          build_image_fn=mock_build_image_fn,
          use_temporary_output_file=True,
      )
      runner_config = kubeflow_dag_runner.KubeflowDagRunnerConfig(
          tfx_image=given_image_name
      )
      runner = kubeflow_dag_runner.KubeflowDagRunner(
          config=runner_config
      )
      pipeline = tfx_pipeline.Pipeline("dummy", "dummy_root")
      with patcher.patch() as context:
          runner.run(pipeline)
      self.assertTrue(context[patcher.USE_TEMPORARY_OUTPUT_FILE])
      self.assertIn(patcher.OUTPUT_FILE_PATH, context)
  
      mock_build_image_fn.assert_called_once_with(given_image_name)
      self.assertEqual(runner_config.tfx_image, built_image_name)
  
file_path: tfx/tfx/tools/cli/handler/kubeflow_dag_runner_patcher_test.py
imports: import os
  from unittest import mock
  import tensorflow
  from tfx.orchestration import pipeline
  from tfx.orchestration.kubeflow import kubeflow_dag_runner
  from tfx.tools.cli.handler import kubeflow_dag_runner_patcher
  from tfx.utils import test_case_utils
label_desc: Use image node_id 2 for calling the KubeflowDagRunnerPatcherTest obj's underlying member method code with example usage: obj.testPatcher() without return types