class_docstr: Abstract class for integration testing concrete Metadata implementations.
  
  Subclasses should override metadata() to return an instance of Metadata that
  has not been entered.
class_docstr_tok: ["Abstract","class","for","integration","testing","concrete","Metadata","implementations",".","Subclasses","should","override","metadata","(",")","to","return","an","instance","of","Metadata","that","has","not","been","entered","."]
code: def testArtifact(self):
      with self.metadata() as m:
          self.assertListEqual([], m.store.get_artifacts())
  
          # Test publish artifact.
          artifact = standard_artifacts.Examples()
          artifact.uri = "uri"
          artifact.split_names = artifact_utils.encode_split_names(
              ["train", "eval"]
          )
          m.publish_artifacts([artifact])
          [artifact] = m.store.get_artifacts()
          # Skip verifying time sensitive fields.
          artifact.ClearField("type_id")
          artifact.ClearField("type")
          artifact.ClearField("create_time_since_epoch")
          artifact.ClearField("last_update_time_since_epoch")
          self.assertProtoEquals(
              """id: 1
          uri: "uri"
          properties {
            key: "split_names"
            value {
              string_value: "[\\"train\\", \\"eval\\"]"
            }
          }
          state: LIVE
          """,
              artifact,
          )
  
          # Test get artifact.
          [artifact] = m.store.get_artifacts()
          self.assertListEqual(
              [artifact], m.get_artifacts_by_uri("uri")
          )
          self.assertListEqual(
              [artifact],
              m.get_artifacts_by_type(
                  standard_artifacts.Examples.TYPE_NAME
              ),
          )
  
          # Test artifact state.
          self.assertEqual(
              artifact.state, metadata_store_pb2.Artifact.LIVE
          )
  
imports: from typing import Mapping
  import tensorflow
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.types.artifact import ArtifactState
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the MetadataTest obj's underlying member method code with example usage: obj.testArtifact() without return types