From 021eedaf693ff34bfe8d824bce48f4f76bbbdee6 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 28 Mar 2025 12:59:16 -0700 Subject: [PATCH] test pod lock manager --- tests/litellm/proxy/db/test_pod_lock_manager.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/litellm/proxy/db/test_pod_lock_manager.py b/tests/litellm/proxy/db/test_pod_lock_manager.py index 8894ea6716..e685172c1e 100644 --- a/tests/litellm/proxy/db/test_pod_lock_manager.py +++ b/tests/litellm/proxy/db/test_pod_lock_manager.py @@ -41,7 +41,9 @@ def pod_lock_manager(): @pytest.mark.asyncio async def test_acquire_lock_success(pod_lock_manager, mock_prisma): - # Mock successful lock acquisition + """ + Test that the lock is acquired successfully if the DB response is successful + """ mock_response = AsyncMock() mock_response.status = "ACTIVE" mock_response.pod_id = pod_lock_manager.pod_id @@ -75,7 +77,9 @@ async def test_acquire_lock_failure(pod_lock_manager, mock_prisma): @pytest.mark.asyncio async def test_renew_lock(pod_lock_manager, mock_prisma): - # Mock successful lock renewal + """ + Test that the renew lock calls the DB update method with the correct parameters + """ mock_prisma.db.litellm_cronjob.update.return_value = AsyncMock() await pod_lock_manager.renew_lock() @@ -91,7 +95,11 @@ async def test_renew_lock(pod_lock_manager, mock_prisma): @pytest.mark.asyncio async def test_release_lock(pod_lock_manager, mock_prisma): - # Mock successful lock release + """ + Test that the release lock calls the DB update method with the correct parameters + + specifically, the status should be set to INACTIVE + """ mock_prisma.db.litellm_cronjob.update.return_value = AsyncMock() await pod_lock_manager.release_lock()