code: def test_download_directory_artifact_succeeds_when_artifact_root_is_blob_container_root(
      mock_client, tmp_path
  ):
      repo = AzureBlobArtifactRepository(
          TEST_BLOB_CONTAINER_ROOT, mock_client
      )
  
      subdir_path = "my_directory"
      dir_prefix = BlobPrefix()
      dir_prefix.name = subdir_path
  
      file_path_1 = "file_1"
      file_path_2 = "file_2"
  
      blob_props_1 = BlobProperties()
      blob_props_1.size = 42
      blob_props_1.name = posixpath.join(subdir_path, file_path_1)
  
      blob_props_2 = BlobProperties()
      blob_props_2.size = 42
      blob_props_2.name = posixpath.join(subdir_path, file_path_2)
  
      def get_mock_listing(*args, **kwargs):
          """
          Produces a mock listing that only contains content if the specified prefix is the artifact
          root or a relevant subdirectory. 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
          if posixpath.abspath(kwargs["name_starts_with"]) == "/":
              return MockBlobList([dir_prefix])
          if posixpath.abspath(
              kwargs["name_starts_with"]
          ) == posixpath.abspath(subdir_path):
              return MockBlobList([blob_props_1, blob_props_2])
          else:
              return MockBlobList([])
  
      def create_file(buffer):
          fname = os.path.basename(buffer.name)
          f = tmp_path.joinpath(fname)
          f.write_text("hello world!")
  
      mock_client.get_container_client().walk_blobs.side_effect = (
          get_mock_listing
      )
      mock_client.get_container_client().download_blob().readinto.side_effect = (
          create_file
      )
  
      # 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 base64
  import os
  import posixpath
  from unittest import mock
  import pytest
  from azure.storage.blob import BlobPrefix, BlobProperties, BlobServiceClient
  from mlflow.entities.multipart_upload import MultipartUploadPart
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.azure_blob_artifact_repo import AzureBlobArtifactRepository
label_desc: Use image node_id 13 for calling a global function with example usage: test_download_directory_artifact_succeeds_when_artifact_root_is_blob_container_root(mock_client, tmp_path) and returns: MockBlobList, MockBlobList, MockBlobList