code: def test_get_gateway_uri(monkeypatch):
      monkeypatch.setattr("mlflow.gateway.utils._gateway_uri", None)
      monkeypatch.delenv("MLFLOW_GATEWAY_URI", raising=False)
  
      with pytest.raises(
          MlflowException, match="No Gateway server uri has been set"
      ):
          get_gateway_uri()
  
      valid_uri = "http://localhost"
      monkeypatch.setattr(
          "mlflow.gateway.utils._gateway_uri", valid_uri
      )
      assert get_gateway_uri() == valid_uri
  
      monkeypatch.delenv("MLFLOW_GATEWAY_URI", raising=False)
      set_gateway_uri(valid_uri)
      assert get_gateway_uri() == valid_uri
  
file_path: mlflow/tests/gateway/test_utils.py
imports: import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.gateway.utils import SearchRoutesToken, _is_valid_uri, assemble_uri_path, check_configuration_route_name_collisions, get_gateway_uri, is_valid_endpoint_name, resolve_route_url, set_gateway_uri
label_desc: Use image node_id 8 for calling a global function with example usage: test_get_gateway_uri(monkeypatch) without return types