code: def test_list_endpoints():
      client = get_deploy_client("http://localhost:5000")
      mock_resp = mock.Mock()
      mock_resp.json.return_value = {
          "endpoints": [
              {
                  "model": {"name": "gpt-4", "provider": "openai"},
                  "name": "completions",
                  "endpoint_type": "llm/v1/completions",
                  "endpoint_url": "http://localhost:5000/endpoints/chat/invocations",
              }
          ]
      }
      mock_resp.status_code = 200
      with mock.patch(
          "requests.Session.request", return_value=mock_resp
      ) as mock_request:
          resp = client.list_endpoints()
          mock_request.assert_called_once()
          assert [r.dict() for r in resp] == [
              {
                  "model": {"name": "gpt-4", "provider": "openai"},
                  "name": "completions",
                  "endpoint_type": "llm/v1/completions",
                  "endpoint_url": "http://localhost:5000/endpoints/chat/invocations",
              }
          ]
          ((_, url), _) = mock_request.call_args
          assert url == "http://localhost:5000/api/2.0/endpoints/"
  
file_path: mlflow/tests/deployments/mlflow/test_mlflow.py
imports: from unittest import mock
  import pytest
  from mlflow.deployments import get_deploy_client
  from mlflow.deployments.mlflow import MlflowDeploymentClient
label_desc: Use image node_id 6 for calling a global function with example usage: test_list_endpoints() without return types