code: def test_multipart_upload_handle_response(
      self,
      mock_s3_multipart_file_upload,
      api,
      example_file: Path,
      upload_url: Optional[str],
      multipart_upload_urls: Optional[dict],
      expect_multipart_upload: bool,
      expect_single_upload: bool,
      expect_deduped: bool,
  ):
      # Tests if we handle uploading correctly depending on what response we get from CreateArtifactFile.
      preparer = mock_preparer(
          prepare_sync=lambda spec: singleton_queue(
              dummy_response_prepare(spec)._replace(
                  upload_url=upload_url,
                  multipart_upload_urls=multipart_upload_urls,
              )
          )
      )
      policy = WandbStoragePolicy(api=api)
      # Mock minimum size for multipart so that we can test multipart
      with mock.patch(
          "wandb.sdk.artifacts.storage_policies.wandb_storage_policy."
          "S3_MIN_MULTI_UPLOAD_SIZE",
          example_file.stat().st_size,
      ):
          # We don't use the store_file fixture since multipart is not available in async
          deduped = self._store_file_sync(
              policy, entry_local_path=example_file, preparer=preparer
          )
          assert deduped == expect_deduped
  
          if expect_multipart_upload:
              mock_s3_multipart_file_upload.assert_called_once()
              api.complete_multipart_upload_artifact.assert_called_once()
              api.upload_file_retry.assert_not_called()
          elif expect_single_upload:
              api.upload_file_retry.assert_called_once()
              api.upload_multipart_file_chunk_retry.assert_not_called()
          else:
              api.upload_file_retry.assert_not_called()
              api.upload_multipart_file_chunk_retry.assert_not_called()
  
imports: import asyncio
  import functools
  import queue
  import shutil
  import unittest.mock
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Mapping, Optional
  from unittest.mock import Mock
  import pytest
  import requests
  from wandb.filesync.step_prepare import ResponsePrepare, StepPrepare
  from wandb.sdk.artifacts.artifact import Artifact
  from wandb.sdk.artifacts.artifact_file_cache import ArtifactFileCache
  from wandb.sdk.artifacts.artifact_instance_cache import artifact_instance_cache
  from wandb.sdk.artifacts.artifact_manifest_entry import ArtifactManifestEntry
  from wandb.sdk.artifacts.exceptions import ArtifactNotLoggedError
  from wandb.sdk.artifacts.storage_policies.wandb_storage_policy import WandbStoragePolicy
label_desc: Use image node_id 13 for calling the TestStoreFile obj's underlying member method code with example usage: obj.test_multipart_upload_handle_response(mock_s3_multipart_file_upload, api, example_file, upload_url, multipart_upload_urls, expect_multipart_upload, expect_single_upload, expect_deduped) without return types