From 45323dd537acb1716c6dc8ab07751dd1064d3ecf Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 7 Nov 2025 22:09:52 -0800 Subject: [PATCH] test_patch_guardrail_endpoint --- litellm/model_prices_and_context_window_backup.json | 2 +- .../proxy/guardrails/test_guardrail_endpoints.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index e24fca72094..9f020fc1ebf 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -11617,7 +11617,7 @@ "tpm": 1000000 }, "gemini/gemini-2.5-flash": { - "cache_read_input_token_cost": 7.5e-08, + "cache_read_input_token_cost": 3e-08, "input_cost_per_audio_token": 1e-06, "input_cost_per_token": 3e-07, "litellm_provider": "gemini", diff --git a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py index a2d072dc7d8..2292bf32040 100644 --- a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py +++ b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py @@ -751,13 +751,14 @@ async def test_patch_guardrail_endpoint( mock_logger = None if scenario == "success_with_sync": mock_prisma_client = mocker.Mock() + mock_in_memory_handler.sync_guardrail_from_db = mocker.Mock() mocker.patch("litellm.proxy.proxy_server.prisma_client", mock_prisma_client) mocker.patch("litellm.proxy.guardrails.guardrail_endpoints.GUARDRAIL_REGISTRY", mock_guardrail_registry) mocker.patch("litellm.proxy.guardrails.guardrail_registry.IN_MEMORY_GUARDRAIL_HANDLER", mock_in_memory_handler) elif scenario == "success_sync_fails": mock_prisma_client = mocker.Mock() - mock_in_memory_handler.update_in_memory_guardrail.side_effect = Exception("Sync failed") + mock_in_memory_handler.sync_guardrail_from_db = mocker.Mock(side_effect=Exception("Sync failed")) mock_logger = mocker.patch("litellm.proxy.guardrails.guardrail_endpoints.verbose_proxy_logger") mocker.patch("litellm.proxy.proxy_server.prisma_client", mock_prisma_client) @@ -792,8 +793,7 @@ async def test_patch_guardrail_endpoint( mock_guardrail_registry.update_guardrail_in_db.assert_called_once() - mock_in_memory_handler.update_in_memory_guardrail.assert_called_once_with( - guardrail_id="test-guardrail-id", + mock_in_memory_handler.sync_guardrail_from_db.assert_called_once_with( guardrail=mocker.ANY )