code: def test_resolve_trial_component(training_job_env, sagemaker_session):
      trial_component_name = "foo-bar"
      client = sagemaker_session.sagemaker_client
      client.list_trial_components.return_value = {
          "TrialComponentSummaries": [
              {"TrialComponentName": trial_component_name}
          ]
      }
      client.describe_trial_component.return_value = {
          "TrialComponentName": trial_component_name
      }
      environment = _environment._RunEnvironment.load()
      tc = environment.get_trial_component(sagemaker_session)
  
      assert trial_component_name == tc.trial_component_name
      client.describe_trial_component.assert_called_with(
          TrialComponentName=trial_component_name
      )
      client.list_trial_components.assert_called_with(
          SourceArn="arn:1234abcde"
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/experiments/test_environment.py
imports: from __future__ import absolute_import
  import json
  import os
  import shutil
  import tempfile
  import unittest.mock
  import pytest
  from sagemaker.experiments import _environment
  from sagemaker.experiments._environment import TRANSFORM_JOB_ARN_ENV, TRAINING_JOB_ARN_ENV
  from sagemaker.utils import retry_with_backoff
label_desc: Use image node_id 8 for calling a global function with example usage: test_resolve_trial_component(training_job_env, sagemaker_session) without return types