code: def test_api_key_parsing_env(tmp_path, monkeypatch):
      monkeypatch.setenv("KEY_AS_ENV", "my_key")
  
      assert _resolve_api_key_from_input("$KEY_AS_ENV") == "my_key"
      monkeypatch.delenv("KEY_AS_ENV", raising=False)
      with pytest.raises(
          MlflowException,
          match="Environment variable 'KEY_AS_ENV' is not set",
      ):
          _resolve_api_key_from_input("$KEY_AS_ENV")
  
      string_key = "my_key_as_a_string"
  
      assert _resolve_api_key_from_input(string_key) == string_key
  
      conf_path = tmp_path.joinpath("mykey.conf")
      file_key = "Here is my key that sits safely in a file"
  
      conf_path.write_text(file_key)
  
      assert _resolve_api_key_from_input(str(conf_path)) == file_key
  
file_path: mlflow/tests/gateway/test_gateway_config_parsing.py
imports: import re
  import warnings
  import pytest
  import yaml
  from mlflow.exceptions import MlflowException
  from mlflow.gateway.config import AnthropicConfig, OpenAIConfig, RouteConfig, _load_route_config, _resolve_api_key_from_input, _save_route_config
  from mlflow.gateway.utils import assemble_uri_path
label_desc: Use image node_id 3 for calling a global function with example usage: test_api_key_parsing_env(tmp_path, monkeypatch) without return types