code: def testPatcherWithOutputFile(self):
      output_filename = "foo.tar.gz"
      patcher = kubeflow_dag_runner_patcher.KubeflowDagRunnerPatcher(
          call_real_run=False,
          build_image_fn=None,
          use_temporary_output_file=True,
      )
      runner = kubeflow_dag_runner.KubeflowDagRunner(
          output_filename=output_filename
      )
      pipeline = tfx_pipeline.Pipeline("dummy", "dummy_root")
      with patcher.patch() as context:
          runner.run(pipeline)
      self.assertFalse(context[patcher.USE_TEMPORARY_OUTPUT_FILE])
      self.assertEqual(
          os.path.basename(context[patcher.OUTPUT_FILE_PATH]),
          output_filename,
      )
      self.assertEqual(runner._output_filename, output_filename)
  
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 3 for calling the KubeflowDagRunnerPatcherTest obj's underlying member method code with example usage: obj.testPatcherWithOutputFile() without return types