code: def testRunSchemaGen(self):
      # Prepare the paths
      test_data_dir = os.path.join(
          os.path.dirname(os.path.dirname(__file__)),
          "components",
          "testdata",
      )
      output_data_dir = os.path.join(
          os.environ.get(
              "TEST_UNDECLARED_OUTPUTS_DIR", tempfile.mkdtemp()
          ),
          self._testMethodName,
      )
      fileio.makedirs(output_data_dir)
  
      # Run SchemaGen
      run_component.run_component(
          full_component_class_name="tfx.components.SchemaGen",
          # Testing that we can specify input artifact paths
          statistics_path=os.path.join(test_data_dir, "statistics_gen"),
          # Testing that we can specify artifact properties
          statistics_split_names=artifact_utils.encode_split_names(
              ["train", "eval"]
          ),
          # Testing that we can pass arguments for non-string properties
          infer_feature_shape="1",
          # Testing that we can specify output artifact paths
          schema_path=os.path.join(output_data_dir),
      )
  
      # Checking the schema_gen outputs
      self.assertTrue(
          fileio.exists(os.path.join(output_data_dir, "schema.pbtxt"))
      )
  
file_path: tfx/tfx/scripts/run_component_test.py
imports: import os
  import pathlib
  import tempfile
  from absl.testing import absltest
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.scripts import run_component
  from tfx.types import artifact_utils
label_desc: Use image node_id 2 for calling the RunComponentTest obj's underlying member method code with example usage: obj.testRunSchemaGen() without return types