code: def test_download_file(
      mlflow_artifact_repo, tmp_path, remote_file_path
  ):
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockStreamResponse("data", 200),
      ) as mock_get:
          tmp_path = tmp_path.joinpath(
              posixpath.basename(remote_file_path)
          )
          mlflow_artifact_repo._download_file(
              remote_file_path, tmp_path
          )
          mock_get.assert_called_once_with(
              mlflow_artifact_repo._host_creds,
              posixpath.join("/", remote_file_path),
              "GET",
              stream=True,
          )
          with open(tmp_path) as f:
              assert f.read() == "data"
  
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockStreamResponse("data", 400),
      ):
          with pytest.raises(Exception, match="request failed"):
              mlflow_artifact_repo._download_file(
                  remote_file_path, tmp_path
              )
  
imports: import os
  import posixpath
  from unittest import mock
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.mlflow_artifacts_repo import MlflowArtifactsRepository
  from mlflow.tracking._tracking_service.utils import _get_default_host_creds
label_desc: Use image node_id 12 for calling a global function with example usage: test_download_file(mlflow_artifact_repo, tmp_path, remote_file_path) without return types