From e014dfb8e0e5b518424be8f61fd580a28f6a415b Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Mon, 30 Mar 2026 21:36:40 -0700 Subject: [PATCH] fix: mock encrypt_value_helper in lifecycle test CI fails because LITELLM_MASTER_KEY is not set, causing encrypt_value_helper to error on NoneType.encode(). Patch it to pass through values unencrypted in the test. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../management_endpoints/test_model_management_endpoints.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py index cbc6f1db3c7..c3e3d1ecbd9 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py @@ -1234,13 +1234,15 @@ class TestAddAndDeleteModelLifecycle: mock_router.delete_deployment = MagicMock() _PS = "litellm.proxy.proxy_server" + _ENCRYPT = "litellm.proxy.management_endpoints.model_management_endpoints.encrypt_value_helper" with patch(f"{_PS}.prisma_client", mock_prisma), \ patch(f"{_PS}.store_model_in_db", True), \ patch(f"{_PS}.proxy_config", mock_proxy_config), \ patch(f"{_PS}.proxy_logging_obj", MagicMock()), \ patch(f"{_PS}.general_settings", {}), \ patch(f"{_PS}.premium_user", True), \ - patch(f"{_PS}.llm_router", mock_router): + patch(f"{_PS}.llm_router", mock_router), \ + patch(_ENCRYPT, side_effect=lambda value, **kwargs: value): # --- ADD --- add_result = await add_new_model(