code: def test_download_artifacts_downloads_expected_content(
      mock_client, tmp_path
  ):
      artifact_root_path = "/experiment_id/run_id/"
      repo = GCSArtifactRepository(
          "gs://test_bucket" + artifact_root_path, mock_client
      )
  
      obj_mock_1 = mock.Mock()
      file_path_1 = "file1"
      obj_mock_1.configure_mock(
          name=os.path.join(artifact_root_path, file_path_1), size=1
      )
      obj_mock_2 = mock.Mock()
      file_path_2 = "file2"
      obj_mock_2.configure_mock(
          name=os.path.join(artifact_root_path, file_path_2), size=1
      )
      mock_populated_results = mock.MagicMock()
      mock_populated_results.__iter__.return_value = [
          obj_mock_1,
          obj_mock_2,
      ]
  
      mock_empty_results = mock.MagicMock()
      mock_empty_results.__iter__.return_value = []
  
      def get_mock_listing(prefix, **kwargs):
          """
          Produces a mock listing that only contains content if the
          specified prefix is the artifact root. This allows us to mock
          `list_artifacts` during the `_download_artifacts_into` subroutine
          without recursively listing the same artifacts at every level of the
          directory traversal.
          """
          # pylint: disable=unused-argument
          prefix = os.path.join("/", prefix)
          if os.path.abspath(prefix) == os.path.abspath(
              artifact_root_path
          ):
              return mock_populated_results
          else:
              return mock_empty_results
  
      def mkfile(fname, **kwargs):
          # pylint: disable=unused-argument
          fname = os.path.basename(fname)
          f = tmp_path.joinpath(fname)
          f.write_text("hello world!")
  
      mock_method_chain(
          mock_client,
          [
              "bucket",
              "list_blobs",
          ],
          side_effect=get_mock_listing,
      )
      mock_method_chain(
          mock_client,
          [
              "bucket",
              "blob",
              "download_to_filename",
          ],
          side_effect=mkfile,
      )
  
      # Ensure that the root directory can be downloaded successfully
      repo.download_artifacts("")
      # Ensure that the `mkfile` side effect copied all of the download artifacts into `tmpdir`
      dir_contents = os.listdir(tmp_path)
      assert file_path_1 in dir_contents
      assert file_path_2 in dir_contents
  
imports: import os
  import posixpath
  from unittest import mock
  import pytest
  import requests
  from google.auth.exceptions import DefaultCredentialsError
  from google.cloud.storage import client
  from mlflow.entities.multipart_upload import MultipartUploadPart
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.gcs_artifact_repo import GCSArtifactRepository, GCSMPUArguments
  from tests.helper_functions import mock_method_chain
label_desc: Use image node_id 11 for calling a global function with example usage: test_download_artifacts_downloads_expected_content(mock_client, tmp_path) and returns: mock_populated_results, mock_empty_results