code: def test_list_artifacts(http_artifact_repo):
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockResponse({}, 200),
      ) as mock_get:
          assert http_artifact_repo.list_artifacts() == []
          endpoint = "/mlflow-artifacts/artifacts"
          url, _ = http_artifact_repo.artifact_uri.split(
              endpoint, maxsplit=1
          )
          mock_get.assert_called_once_with(
              _get_default_host_creds(url),
              endpoint,
              "GET",
              params={"path": ""},
          )
  
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockResponse(
              {
                  "files": [
                      {
                          "path": "1.txt",
                          "is_dir": False,
                          "file_size": 1,
                      },
                      {"path": "dir", "is_dir": True},
                  ]
              },
              200,
          ),
      ):
          assert [
              a.path for a in http_artifact_repo.list_artifacts()
          ] == ["1.txt", "dir"]
  
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockResponse(
              {
                  "files": [
                      {
                          "path": "1.txt",
                          "is_dir": False,
                          "file_size": 1,
                      },
                      {"path": "dir", "is_dir": True},
                  ]
              },
              200,
          ),
      ):
          assert [
              a.path
              for a in http_artifact_repo.list_artifacts(path="path")
          ] == [
              "path/1.txt",
              "path/dir",
          ]
  
      with mock.patch(
          "mlflow.store.artifact.http_artifact_repo.http_request",
          return_value=MockResponse({}, 400),
      ):
          with pytest.raises(Exception, match="request failed"):
              http_artifact_repo.list_artifacts()
  
imports: import os
  import posixpath
  from unittest import mock
  import pytest
  from requests import HTTPError
  from mlflow.entities.multipart_upload import CreateMultipartUploadResponse, MultipartUploadCredential, MultipartUploadPart
  from mlflow.environment_variables import MLFLOW_MULTIPART_UPLOAD_MINIMUM_FILE_SIZE, MLFLOW_TRACKING_CLIENT_CERT_PATH, MLFLOW_TRACKING_INSECURE_TLS, MLFLOW_TRACKING_PASSWORD, MLFLOW_TRACKING_SERVER_CERT_PATH, MLFLOW_TRACKING_TOKEN, MLFLOW_TRACKING_USERNAME
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.http_artifact_repo import HttpArtifactRepository
  from mlflow.tracking._tracking_service.utils import _get_default_host_creds
  from mlflow.utils.rest_utils import MlflowHostCreds
label_desc: Use image node_id 5 for calling a global function with example usage: test_list_artifacts(http_artifact_repo) without return types