diff --git a/tests/proxy_unit_tests/test_proxy_config_unit_test.py b/tests/proxy_unit_tests/test_proxy_config_unit_test.py index 98ee0969f8c..909acfdceb7 100644 --- a/tests/proxy_unit_tests/test_proxy_config_unit_test.py +++ b/tests/proxy_unit_tests/test_proxy_config_unit_test.py @@ -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