test(proxy): wrap cli and bug report config mocks in ProxyRuntimeConfig

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-10-08 04:55:10 +00:00
parent 936c1e9f1b
commit c1e7281d29
2 changed files with 5 additions and 4 deletions

View file

@ -5,6 +5,7 @@ from collections.abc import Iterator, Mapping
import pytest
from litellm.proxy import proxy_server
from litellm.proxy._types import ProxyRuntimeConfig
from litellm.proxy.bug_report_config import build_proxy_bug_report, build_proxy_environment_report, safe_config_lines
CUSTOMER_STRINGS = (
@ -183,7 +184,7 @@ def test_malformed_sections_produce_no_lines():
@pytest.fixture
def loaded_proxy_config(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
previous_config = proxy_server.proxy_config.get_config_state()
proxy_server.proxy_config.update_config_state(config=CUSTOMER_CONFIG)
proxy_server.proxy_config.update_config_state(config=ProxyRuntimeConfig.from_resolved(CUSTOMER_CONFIG))
monkeypatch.setattr(proxy_server, "general_settings", dict(CUSTOMER_GENERAL_SETTINGS))
yield
proxy_server.proxy_config.update_config_state(config=previous_config)

View file

@ -1259,7 +1259,7 @@ class TestProxyInitializationHelpers:
save_worker_config=MagicMock(),
)
mock_proxy_module.ProxyConfig.return_value.get_config = AsyncMock(
return_value={"general_settings": general_settings}
return_value=ProxyRuntimeConfig.from_resolved({"general_settings": general_settings})
)
clean_env = {
@ -1334,12 +1334,12 @@ class TestProxyInitializationHelpers:
save_worker_config=MagicMock(),
)
mock_proxy_module.ProxyConfig.return_value.get_config = AsyncMock(
return_value={
return_value=ProxyRuntimeConfig.from_resolved({
"general_settings": {
"database_url": "postgresql://test:test@localhost:5432/test",
"database_disable_prepared_statements": True,
}
}
})
)
clean_env = {