test(proxy): run secure_share tests in CI shard and cover all branches

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Mubashir Osmani 2026-07-10 20:27:06 +00:00
parent c643f6d1af
commit 858a8b5fce
2 changed files with 15 additions and 0 deletions

View file

@ -46,6 +46,7 @@ jobs:
tests/test_litellm/proxy/rag_endpoints
tests/test_litellm/proxy/realtime_endpoints
tests/test_litellm/proxy/ui_crud_endpoints
tests/test_litellm/proxy/secure_share
tests/test_litellm/proxy/utils
workers: 2
reruns: 2

View file

@ -93,6 +93,20 @@ def test_create_request_rejects_unknown_expiry():
SecureShareCreateRequest(ciphertext=_b64(b"c"), salt=_b64(b"s"), iv=_b64(b"i"), expiry="30d")
def test_create_request_rejects_empty_ciphertext():
with pytest.raises(ValidationError):
SecureShareCreateRequest(ciphertext="", salt=_b64(b"s"), iv=_b64(b"i"), expiry="1h")
@pytest.mark.asyncio
async def test_create_returns_500_when_db_not_connected():
with patch.multiple("litellm.proxy.proxy_server", prisma_client=None, litellm_proxy_admin_name="default_admin"):
with pytest.raises(HTTPException) as exc:
await create_secure_share(request=_valid_request(), user_api_key_dict=_admin())
assert exc.value.status_code == 500
@pytest.mark.asyncio
async def test_create_stores_ciphertext_and_computes_expiry():
request = _valid_request(SecureShareExpiry.ONE_DAY)