code: def testGetSchema(self, mock_execute_dsl):
      temp_pipeline_root = os.path.join(self.tmp_dir, "pipeline_root")
  
      handler = kubeflow_handler.KubeflowHandler(
          {labels.ENGINE_FLAG: self.engine}
      )
      assert isinstance(handler, kubeflow_handler.KubeflowHandler)
      mock_execute_dsl.return_value = {
          kubeflow_dag_runner_patcher.KubeflowDagRunnerPatcher.PIPELINE_NAME: self.pipeline_name,
          kubeflow_dag_runner_patcher.KubeflowDagRunnerPatcher.PIPELINE_ROOT: temp_pipeline_root,
      }
  
      # No pipeline root
      with self.assertRaises(SystemExit) as err:
          handler.get_schema()
      self.assertEqual(
          str(err.exception),
          "Create a run before inferring schema. If pipeline is already running, then wait for it to successfully finish.",
      )
  
      # No SchemaGen output.
      fileio.makedirs(temp_pipeline_root)
      with self.assertRaises(SystemExit) as err:
          handler.get_schema()
      self.assertEqual(
          str(err.exception),
          "Either SchemaGen component does not exist or pipeline is still running. If pipeline is running, then wait for it to successfully finish.",
      )
  
      # Successful pipeline run.
      # Create fake schema in pipeline root.
      component_output_dir = os.path.join(
          temp_pipeline_root, "SchemaGen"
      )
      schema_path = base_driver._generate_output_uri(  # pylint: disable=protected-access
          component_output_dir, "schema", 3
      )
      fileio.makedirs(schema_path)
      with open(os.path.join(schema_path, "schema.pbtxt"), "w") as f:
          f.write("SCHEMA")
      with self.captureWritesToStream(sys.stdout) as captured:
          handler.get_schema()
          curr_dir_path = os.path.join(os.getcwd(), "schema.pbtxt")
          self.assertIn(
              "Path to schema: {}".format(curr_dir_path),
              captured.contents(),
          )
          self.assertIn(
              "*********SCHEMA FOR {}**********".format(
                  self.pipeline_name.upper()
              ),
              captured.contents(),
          )
          self.assertTrue(fileio.exists(curr_dir_path))
  
imports: import datetime
  import os
  import sys
  from unittest import mock
  import kfp
  import tensorflow
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.io import fileio
  from tfx.tools.cli import labels
  from tfx.tools.cli.handler import kubeflow_dag_runner_patcher
  from tfx.tools.cli.handler import kubeflow_handler
  from tfx.utils import test_case_utils
label_desc: Use image node_id 9 for calling the KubeflowHandlerTest obj's underlying member method code with example usage: obj.testGetSchema(mock_execute_dsl) without return types