code: def testDriverJsonContract(self):
      # This test is identical to testDriverWithoutSpan, but uses raw JSON strings
      # for inputs and expects against the raw JSON output of the driver, to
      # better illustrate the JSON I/O contract of the driver.
      split1 = os.path.join(_TEST_INPUT_DIR, "split1", "data")
      io_utils.write_string_file(split1, "testing")
      os.utime(split1, (0, 1))
      split2 = os.path.join(_TEST_INPUT_DIR, "split2", "data")
      io_utils.write_string_file(split2, "testing2")
      os.utime(split2, (0, 3))
  
      serialized_args = [
          "--json_serialized_invocation_args",
          self._executor_invocation_from_file,
      ]
  
      # Invoke the driver
      driver.main(driver._parse_flags(serialized_args))
  
      # Check the output metadata file for the expected outputs
      with fileio.open(
          _TEST_OUTPUT_METADATA_JSON, "rb"
      ) as output_meta_json:
          self.assertEqual(
              json.dumps(
                  json.loads(output_meta_json.read()),
                  indent=2,
                  sort_keys=True,
              ),
              json.dumps(
                  json.loads(self._expected_result_from_file),
                  indent=2,
                  sort_keys=True,
              ),
          )
  
file_path: tfx/tfx/orchestration/kubeflow/v2/file_based_example_gen/driver_test.py
imports: import json
  import os
  from absl import logging
  from kfp.pipeline_spec import pipeline_spec_pb2
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration.kubeflow.v2 import compiler_utils
  from tfx.orchestration.kubeflow.v2.file_based_example_gen import driver
  from tfx.proto import example_gen_pb2
  from tfx.types import standard_artifacts
  from tfx.utils import io_utils
  from tfx.utils import test_case_utils
  from google.protobuf import json_format
label_desc: Use image node_id 4 for calling the RunDriverTest obj's underlying member method code with example usage: obj.testDriverJsonContract() without return types