code: def test_create_delete_with_association(sagemaker_session):
      obj = action.Action(
          sagemaker_session,
          action_name="foo",
          action_arn="a1",
          description="updated-description",
          status="updated-status",
          properties={"k1": "v1"},
          properties_to_remove=["k2"],
      )
  
      sagemaker_session.sagemaker_client.list_associations.side_effect = [
          {
              "AssociationSummaries": [
                  {
                      "SourceArn": obj.action_arn,
                      "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": None,
                      "CreatedBy": {},
                  }
                  for i in range(1)
              ],
          },
          {
              "AssociationSummaries": [
                  {
                      "SourceArn": "A" + str(i),
                      "SourceName": "X" + str(i),
                      "DestinationArn": obj.action_arn,
                      "DestinationName": "Y" + str(i),
                      "SourceType": "C" + str(i),
                      "DestinationType": "D" + str(i),
                      "AssociationType": "E" + str(i),
                      "CreationTime": None,
                      "CreatedBy": {},
                  }
                  for i in range(1, 2)
              ]
          },
      ]
      sagemaker_session.sagemaker_client.delete_association.return_value = (
          {}
      )
      sagemaker_session.sagemaker_client.delete_action.return_value = {}
  
      obj.delete(disassociate=True)
  
      delete_with_association_expected_calls = [
          unittest.mock.call(
              SourceArn=obj.action_arn, DestinationArn="B0"
          ),
          unittest.mock.call(
              SourceArn="A1", DestinationArn=obj.action_arn
          ),
      ]
      assert (
          delete_with_association_expected_calls
          == sagemaker_session.sagemaker_client.delete_association.mock_calls
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/lineage/test_action.py
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  from sagemaker.lineage import action, _api_types
  from sagemaker.lineage._api_types import ActionSource
label_desc: Use image node_id 11 for calling a global function with example usage: test_create_delete_with_association(sagemaker_session) without return types