mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
test(proxy): cover response storage normalization
This commit is contained in:
parent
9cbeee4946
commit
11be22338d
1 changed files with 25 additions and 0 deletions
|
|
@ -365,3 +365,28 @@ class TestYamlStorePromptsDbOverride:
|
|||
)
|
||||
|
||||
assert test_general_settings["store_responses_in_spend_logs"] is False
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
("db_value", "expected"),
|
||||
[
|
||||
(None, None),
|
||||
(True, True),
|
||||
("TRUE", True),
|
||||
(0, False),
|
||||
],
|
||||
)
|
||||
async def test_response_storage_db_value_is_normalized_when_yaml_omits_key(
|
||||
self,
|
||||
db_value,
|
||||
expected,
|
||||
):
|
||||
proxy_config = self._make_proxy_config_with_yaml_keys({"master_key"})
|
||||
test_general_settings = {"master_key": "sk-test"}
|
||||
|
||||
with mock.patch("litellm.proxy.proxy_server.general_settings", test_general_settings):
|
||||
await proxy_config._update_general_settings(
|
||||
db_general_settings={"store_responses_in_spend_logs": db_value},
|
||||
)
|
||||
|
||||
assert test_general_settings["store_responses_in_spend_logs"] is expected
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue