code: def test_download_artifacts(dbfs_artifact_repo):
      with mock.patch(
          DBFS_ARTIFACT_REPOSITORY + "._dbfs_is_dir"
      ) as is_dir_mock, mock.patch(
          DBFS_ARTIFACT_REPOSITORY + "._dbfs_list_api"
      ) as list_mock, mock.patch(
          DBFS_ARTIFACT_REPOSITORY + "._dbfs_download"
      ) as download_mock:
          is_dir_mock.side_effect = [
              True,
              False,
              True,
          ]
          list_mock.side_effect = [
              Mock(text=json.dumps(LIST_ARTIFACTS_RESPONSE)),
              Mock(text="{}"),  # this call is for listing `/dir`.
              Mock(text="{}"),  # this call is for listing `/dir/a.txt`.
          ]
          dbfs_artifact_repo.download_artifacts("/")
          assert list_mock.call_count == 2
          assert download_mock.call_count == 1
          chronological_download_calls = list(
              download_mock.call_args_list
          )
          # Calls are in reverse chronological order by default
          chronological_download_calls.reverse()
          _, kwargs_call = chronological_download_calls[0]
          assert kwargs_call["endpoint"] == "/dbfs/test/a.txt"
  
imports: import json
  import os
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.dbfs_artifact_repo import DbfsRestArtifactRepository, _get_host_creds_from_default_store
  from mlflow.store.tracking.file_store import FileStore
  from mlflow.store.tracking.rest_store import RestStore
  from mlflow.utils.rest_utils import MlflowHostCreds, http_request
label_desc: Use image node_id 14 for calling a global function with example usage: test_download_artifacts(dbfs_artifact_repo) without return types