code: def test_list(sagemaker_session):
      creation_time = datetime.datetime.now(
          datetime.timezone.utc
      ) + datetime.timedelta(hours=3)
  
      sagemaker_session.sagemaker_client.list_associations.side_effect = [
          {
              "AssociationSummaries": [
                  {
                      "SourceArn": "A" + str(i),
                      "SourceName": "X" + str(i),
                      "DestinationArn": "B" + str(i),
                      "DestinationName": "Y" + str(i),
                      "SourceType": "C" + str(i),
                      "DestinationType": "D" + str(i),
                      "AssociationType": "E" + str(i),
                      "CreationTime": creation_time
                      + datetime.timedelta(hours=i),
                      "CreatedBy": {
                          "UserProfileArn": "profileArn",
                          "UserProfileName": "profileName",
                          "DomainId": "domainId",
                      },
                  }
                  for i in range(10)
              ],
              "NextToken": "100",
          },
          {
              "AssociationSummaries": [
                  {
                      "SourceArn": "A" + str(i),
                      "SourceName": "X" + str(i),
                      "DestinationArn": "B" + str(i),
                      "DestinationName": "Y" + str(i),
                      "SourceType": "C" + str(i),
                      "DestinationType": "D" + str(i),
                      "AssociationType": "E" + str(i),
                      "CreationTime": creation_time
                      + datetime.timedelta(hours=i),
                      "CreatedBy": {
                          "UserProfileArn": "profileArn",
                          "UserProfileName": "profileName",
                          "DomainId": "domainId",
                      },
                  }
                  for i in range(10, 20)
              ]
          },
      ]
  
      expected = [
          _api_types.AssociationSummary(
              source_arn="A" + str(i),
              source_name="X" + str(i),
              destination_arn="B" + str(i),
              destination_name="Y" + str(i),
              source_type="C" + str(i),
              destination_type="D" + str(i),
              association_type="E" + str(i),
              creation_time=creation_time + datetime.timedelta(hours=i),
              created_by=_api_types.UserContext(
                  user_profile_arn="profileArn",
                  user_profile_name="profileName",
                  domain_id="domainId",
              ),
          )
          for i in range(20)
      ]
      result = list(
          association.Association.list(
              sagemaker_session=sagemaker_session,
              source_arn="foo",
              destination_arn="bar",
              sort_by="CreationTime",
              sort_order="Ascending",
          )
      )
  
      assert expected == result
      expected_calls = [
          unittest.mock.call(
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceArn="foo",
              DestinationArn="bar",
          ),
          unittest.mock.call(
              NextToken="100",
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceArn="foo",
              DestinationArn="bar",
          ),
      ]
      assert (
          expected_calls
          == sagemaker_session.sagemaker_client.list_associations.mock_calls
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/lineage/test_association.py
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  from sagemaker.lineage import association, _api_types
label_desc: Use image node_id 4 for calling a global function with example usage: test_list(sagemaker_session) without return types