mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
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:
parent
c643f6d1af
commit
858a8b5fce
2 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue