code: def testFetchLastBlessedModel(self):
      # Mock metadata.
      mock_metadata = tf.compat.v1.test.mock.Mock()
      model_validator_driver = driver.Driver(mock_metadata)
      component_id = "test_component"
      pipeline_name = "test_pipeline"
  
      # No blessed model.
      mock_metadata.get_artifacts_by_type.return_value = []
      self.assertEqual(
          (None, None),
          model_validator_driver._fetch_last_blessed_model(
              pipeline_name, component_id
          ),
      )
  
      # Mock blessing artifacts.
      artifacts = [
          self._create_mock_artifact(
              aid, aid % 2, pipeline_name, component_id
          )
          for aid in [4, 3, 2, 1]
      ]
  
      # Mock blessing artifact produced by another component.
      artifacts.append(
          self._create_mock_artifact(
              aid=5,
              is_blessed=True,
              pipeline_name=pipeline_name,
              component_id="different_component",
          )
      )
  
      mock_metadata.get_artifacts_by_type.return_value = artifacts
      self.assertEqual(
          ("uri-3", 3),
          model_validator_driver._fetch_last_blessed_model(
              pipeline_name, component_id
          ),
      )
  
      # Mock blessing artifact produced by another pipeline.
      artifacts.append(
          self._create_mock_artifact(
              aid=6,
              is_blessed=True,
              pipeline_name="different_pipeline",
              component_id=component_id,
          )
      )
  
      mock_metadata.get_artifacts_by_type.return_value = artifacts
      self.assertEqual(
          ("uri-3", 3),
          model_validator_driver._fetch_last_blessed_model(
              pipeline_name, component_id
          ),
      )
  
imports: import tensorflow
  from tfx.components.model_validator import driver
  from tfx.types import standard_artifacts
label_desc: Use image node_id 2 for calling the DriverTest obj's underlying member method code with example usage: obj.testFetchLastBlessedModel() without return types