code: def testInvalidArtifact(self):
      with self.assertRaisesRegex(
          ValueError, 'The "mlmd_artifact_type" argument must be passed'
      ):
          artifact.Artifact()
  
      class MyBadArtifact(artifact.Artifact):
          # No TYPE_NAME
          pass
  
      with self.assertRaisesRegex(
          ValueError,
          "The Artifact subclass .* must override the TYPE_NAME attribute ",
      ):
          MyBadArtifact()
  
      class MyNewArtifact(artifact.Artifact):
          TYPE_NAME = "MyType"
  
      # Okay without additional type_name argument.
      MyNewArtifact()
  
      # Not okay to pass type_name on subclass.
      with self.assertRaisesRegex(
          ValueError,
          'The "mlmd_artifact_type" argument must not be passed for Artifact '
          "subclass",
      ):
          MyNewArtifact(
              mlmd_artifact_type=metadata_store_pb2.ArtifactType()
          )
  
imports: import json
  import textwrap
  from unittest import mock
  from absl import logging
  import tensorflow
  from tfx.types import artifact
  from tfx.types import system_artifacts
  from tfx.types import value_artifact
  from tfx.utils import json_utils
  from google.protobuf import struct_pb2
  from google.protobuf import json_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the ArtifactTest obj's underlying member method code with example usage: obj.testInvalidArtifact() without return types