code: def testResolveArtifactSuccess(self):
      examples_1 = standard_artifacts.Examples()
      examples_1.uri = "my/uri"
      examples_2 = standard_artifacts.Examples()
      examples_2.uri = "another/uri"
  
      with metadata.Metadata(
          connection_config=self.connection_config
      ) as m:
          contexts = m.register_pipeline_contexts_if_not_exists(
              self.pipeline_info
          )
          for examples in [examples_1, examples_2]:
              m.publish_artifacts([examples])
              m.register_execution(
                  exec_properties={},
                  pipeline_info=self.pipeline_info,
                  component_info=self.component_info,
                  contexts=contexts,
              )
              m.publish_execution(
                  component_info=self.component_info,
                  output_artifacts={"key": [examples]},
              )
  
          driver = resolver._ResolverDriver(metadata_handle=m)
          output_dict = self.source_channels.copy()
          with self.subTest("With LatestArtifactStrategy"):
              execution_result = driver.pre_execution(
                  component_info=self.component_info,
                  pipeline_info=self.pipeline_info,
                  driver_args=self.driver_args,
                  input_dict=self.source_channels,
                  output_dict=output_dict,
                  exec_properties={
                      resolver.RESOLVER_STRATEGY_CLASS: latest_artifact_strategy.LatestArtifactStrategy,
                      resolver.RESOLVER_CONFIG: {
                          "desired_num_of_artifacts": 1
                      },
                  },
              )
              self.assertTrue(execution_result.use_cached_results)
              self.assertEmpty(execution_result.input_dict)
              self.assertDictEqual(
                  execution_result.exec_properties,
                  {
                      resolver.RESOLVER_STRATEGY_CLASS: latest_artifact_strategy.LatestArtifactStrategy,
                      resolver.RESOLVER_CONFIG: {
                          "desired_num_of_artifacts": 1
                      },
                  },
              )
              self.assertEqual(
                  self.as_uri_map(execution_result.output_dict),
                  {self.source_channel_key: {examples_2.uri}},
              )
  
          with self.subTest("No strategy"):
              execution_result = driver.pre_execution(
                  component_info=self.component_info,
                  pipeline_info=self.pipeline_info,
                  driver_args=self.driver_args,
                  input_dict=self.source_channels,
                  output_dict=output_dict,
                  exec_properties={},
              )
              self.assertTrue(execution_result.use_cached_results)
              self.assertEmpty(execution_result.input_dict)
              self.assertEmpty(execution_result.exec_properties)
              self.assertEqual(
                  self.as_uri_map(execution_result.output_dict),
                  {
                      self.source_channel_key: {
                          examples_1.uri,
                          examples_2.uri,
                      }
                  },
              )
  
imports: import tensorflow
  from tfx import types
  from tfx.dsl.components.common import resolver
  from tfx.dsl.input_resolution import canned_resolver_functions
  from tfx.dsl.input_resolution.strategies import latest_artifact_strategy
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.types import channel
  from tfx.types import standard_artifacts
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the ResolverDriverTest obj's underlying member method code with example usage: obj.testResolveArtifactSuccess() without return types