code: def test_get_write_credential_infos_handles_pagination(
      databricks_artifact_repo,
  ):
      """
      Verifies that the `_get_write_credential_infos` method, which is used to resolve write
      access credentials for a collection of artifacts, handles paginated responses properly,
      issuing incremental requests until all pages have been consumed
      """
      credential_infos_mock_1 = [
          ArtifactCredentialInfo(
              signed_uri="http://mock_url_1",
              type=ArtifactCredentialType.AWS_PRESIGNED_URL,
          ),
          ArtifactCredentialInfo(
              signed_uri="http://mock_url_2",
              type=ArtifactCredentialType.AWS_PRESIGNED_URL,
          ),
      ]
      credential_infos_mock_2 = [
          ArtifactCredentialInfo(
              signed_uri="http://mock_url_3",
              type=ArtifactCredentialType.AWS_PRESIGNED_URL,
          )
      ]
      credential_infos_mock_3 = []
      get_credentials_for_write_responses = [
          GetCredentialsForWrite.Response(
              credential_infos=credential_infos_mock_1,
              next_page_token="2",
          ),
          GetCredentialsForWrite.Response(
              credential_infos=credential_infos_mock_2,
              next_page_token="3",
          ),
          GetCredentialsForWrite.Response(
              credential_infos=credential_infos_mock_3
          ),
      ]
      with mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY_PACKAGE}.message_to_json"
      ) as message_mock, mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._call_endpoint",
          side_effect=get_credentials_for_write_responses,
      ) as call_endpoint_mock:
          write_credential_infos = (
              databricks_artifact_repo._get_write_credential_infos(
                  ["testpath"]
              )
          )
          assert (
              write_credential_infos
              == credential_infos_mock_1 + credential_infos_mock_2
          )
          message_mock.assert_has_calls(
              [
                  mock.call(
                      GetCredentialsForWrite(
                          run_id=MOCK_RUN_ID, path=["testpath"]
                      )
                  ),
                  mock.call(
                      GetCredentialsForWrite(
                          run_id=MOCK_RUN_ID,
                          path=["testpath"],
                          page_token="2",
                      )
                  ),
                  mock.call(
                      GetCredentialsForWrite(
                          run_id=MOCK_RUN_ID,
                          path=["testpath"],
                          page_token="3",
                      )
                  ),
              ]
          )
          assert call_endpoint_mock.call_count == 3
  
imports: import json
  import os
  import posixpath
  import re
  import shutil
  import time
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  from requests.models import Response
  from mlflow.entities.file_info import FileInfo
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_artifacts_pb2 import ArtifactCredentialInfo, ArtifactCredentialType, CompleteMultipartUpload, CreateMultipartUpload, GetCredentialsForRead, GetCredentialsForWrite, GetPresignedUploadPartUrl
  from mlflow.protos.service_pb2 import FileInfo, ListArtifacts
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.databricks_artifact_repo import _MAX_CREDENTIALS_REQUEST_SIZE, DatabricksArtifactRepository
label_desc: Use image node_id 26 for calling a global function with example usage: test_get_write_credential_infos_handles_pagination(databricks_artifact_repo) without return types