test: fix schema and env override tests - add supports_preset to model prices schema; use LITELLM_MAX_CALLBACKS for MAX_CALLBACKS override test

This commit is contained in:
Alexsander Hamir 2026-02-10 11:09:34 -08:00
parent 9b9926bb59
commit e3b070ea83
2 changed files with 10 additions and 1 deletions

View file

@ -38,6 +38,11 @@ def test_all_numeric_constants_can_be_overridden():
print("all numeric constants", json.dumps(numeric_constants, indent=4))
# Constants that use a different env var name than the constant name
constant_to_env_var = {
"MAX_CALLBACKS": "LITELLM_MAX_CALLBACKS",
}
# Verify all numeric constants have environment variable support
for name, value in numeric_constants:
# Skip constants that are not meant to be overridden (if any)
@ -47,8 +52,11 @@ def test_all_numeric_constants_can_be_overridden():
# Create a test value that's different from the default
test_value = value + 1 if isinstance(value, int) else value + 0.1
# Use the env var name that the constants module actually reads
env_var_name = constant_to_env_var.get(name, name)
# Set the environment variable
with mock.patch.dict(os.environ, {name: str(test_value)}):
with mock.patch.dict(os.environ, {env_var_name: str(test_value)}):
print("overriding", name, "with", test_value)
importlib.reload(constants)

View file

@ -661,6 +661,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"supports_url_context": {"type": "boolean"},
"supports_reasoning": {"type": "boolean"},
"supports_service_tier": {"type": "boolean"},
"supports_preset": {"type": "boolean"},
"tool_use_system_prompt_tokens": {"type": "number"},
"tpm": {"type": "number"},
"supported_endpoints": {