code: def testGenerateOutputArtifacts(
      self, exec_mode, artifact_name_prefix
  ):
      output_artifacts = self._output_resolver(
          exec_mode
      ).generate_output_artifacts(1)
      self.assertIn("output_1", output_artifacts)
      self.assertIn("output_2", output_artifacts)
      self.assertIn("output_3", output_artifacts)
      self.assertIn("output_4", output_artifacts)
      self.assertIn("output_5", output_artifacts)
      self.assertIn("output_6", output_artifacts)
      self.assertIn("output_7", output_artifacts)
      self.assertLen(output_artifacts["output_1"], 1)
      self.assertLen(output_artifacts["output_2"], 1)
      self.assertLen(output_artifacts["output_3"], 1)
      self.assertLen(output_artifacts["output_4"], 1)
      # If there are multiple external_artifact_uris,
      # it has to make multiple artifacts of the same number.
      self.assertLen(output_artifacts["output_5"], 2)
      self.assertLen(output_artifacts["output_6"], 1)
      self.assertLen(output_artifacts["output_7"], 1)
  
      artifact_1 = output_artifacts["output_1"][0]
      self.assertRegex(artifact_1.uri, ".*/test_node/output_1/1")
      self.assertProtoEquals(
          """
          id: 1
          name: "test_type_1"
          properties {
            key: "int_prop"
            value: INT
          }
          properties {
            key: "string_prop"
            value: STRING
          }
          properties {
            key: "float_prop"
            value: DOUBLE
          }
          properties {
            key: "proto_prop"
            value: PROTO
          }
          """,
          artifact_1.artifact_type,
      )
      self.assertLen(artifact_1.mlmd_artifact.properties, 4)
      self.assertLen(artifact_1.mlmd_artifact.custom_properties, 4)
      self.assertEqual(artifact_1.int_prop, 42)
      self.assertEqual(artifact_1.float_prop, 0.5)
      self.assertEqual(artifact_1.string_prop, "foo")
      self.assertEqual(artifact_1.proto_prop.string_value, "aaa")
      self.assertEqual(
          artifact_1.get_int_custom_property("int_custom_prop"), 21
      )
      self.assertEqual(
          artifact_1.get_string_custom_property("string_custom_prop"),
          "bar",
      )
      self.assertEqual(
          artifact_1.get_float_custom_property("float_custom_prop"),
          0.25,
      )
      self.assertEqual(
          artifact_1.get_proto_custom_property(
              "proto_custom_prop"
          ).string_value,
          "bbb",
      )
  
      artifact_2 = output_artifacts["output_2"][0]
      self.assertRegex(artifact_2.uri, ".*/test_node/output_2/1")
      self.assertProtoEquals(
          """
          id: 2
          name: "test_type_2"
          """,
          artifact_2.artifact_type,
      )
      self.assertEmpty(artifact_2.mlmd_artifact.properties)
      self.assertEmpty(artifact_2.mlmd_artifact.custom_properties)
  
      artifact_3 = output_artifacts["output_3"][0]
      self.assertRegex(artifact_3.uri, ".*/test_node/output_3/1/value")
      self.assertProtoEquals(
          """
          id: 3
          name: "String"
          """,
          artifact_3.artifact_type,
      )
  
      artifact_4 = output_artifacts["output_4"][0]
      self.assertRegex(artifact_4.uri, ".*/test_node/output_4/1/value")
      self.assertProtoEquals(
          """
          id: 4
          name: "Integer_Metrics"
          """,
          artifact_4.artifact_type,
      )
  
      artifact_5_0 = output_artifacts["output_5"][0]
      self.assertEqual(artifact_5_0.uri, "/external_directory_1/123")
      self.assertTrue(artifact_5_0.is_external)
  
      artifact_5_1 = output_artifacts["output_5"][1]
      self.assertEqual(artifact_5_1.uri, "/external_directory_2/456")
      self.assertTrue(artifact_5_1.is_external)
  
      artifact_6 = output_artifacts["output_6"][0]
      self.assertEqual(artifact_6.uri, "/external_directory_3/789")
      self.assertTrue(artifact_6.is_external)
  
      artifact_7 = output_artifacts["output_7"][0]
      self.assertEqual(
          artifact_7.uri, outputs_utils.RESOLVED_AT_RUNTIME
      )
      self.assertTrue(artifact_7.is_external)
  
imports: import os
  from unittest import mock
  from absl.testing import parameterized
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types_utils
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable import outputs_utils
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact
  from tfx.types import standard_artifacts
  from tfx.types.value_artifact import ValueArtifact
  from tfx.utils import test_case_utils
  from google.protobuf import text_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling the OutputUtilsTest obj's underlying member method code with example usage: obj.testGenerateOutputArtifacts(exec_mode, artifact_name_prefix) without return types