code: def testPatcherSavePipelineFn(self):
      pipeline_name = "dummy"
      pipeline_dir = "/foo/pipeline"
      mock_prepare_dir_fn = mock.MagicMock(return_value=pipeline_dir)
      patcher = (
          kubeflow_v2_dag_runner_patcher.KubeflowV2DagRunnerPatcher(
              call_real_run=False, prepare_dir_fn=mock_prepare_dir_fn
          )
      )
      runner = kubeflow_v2_dag_runner.KubeflowV2DagRunner(
          config=kubeflow_v2_dag_runner.KubeflowV2DagRunnerConfig()
      )
      pipeline = tfx_pipeline.Pipeline(pipeline_name, "dummy_root")
      with patcher.patch() as context:
          runner.run(pipeline)
  
      mock_prepare_dir_fn.assert_called_once_with(pipeline_name)
      self.assertEqual(
          context[patcher.OUTPUT_FILE_PATH],
          os.path.join(
              pipeline_dir,
              kubeflow_v2_dag_runner_patcher.OUTPUT_FILENAME,
          ),
      )
  
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 3 for calling the KubeflowV2DagRunnerPatcherTest obj's underlying member method code with example usage: obj.testPatcherSavePipelineFn() without return types