mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
Removes the suite README — its contents (local repro, layout, conventions) were either restated by the file structure or already covered by the workflow YAML and pyproject.toml. Trims docstrings and inline comments across every test file to keep only non-obvious WHY (the masking ``_get_user_in_team`` reads, the LiteLLM_VerificationTokenView models-can't- be-NULL gotcha, the org_admin/peer-visibility surprise, the rotation contract). Suite still 129 green locally.
28 lines
846 B
Python
28 lines
846 B
Python
import pytest
|
|
|
|
from .conftest import MASTER_KEY
|
|
|
|
pytestmark = pytest.mark.asyncio(loop_scope="session")
|
|
|
|
|
|
async def test_liveliness(proxy_client):
|
|
resp = await proxy_client.get("/health/liveliness")
|
|
assert resp.status_code == 200
|
|
|
|
|
|
async def test_key_generate_lands_in_db(proxy_client, prisma, scratch):
|
|
from litellm.proxy.utils import hash_token
|
|
|
|
resp = await proxy_client.post(
|
|
"/key/generate",
|
|
headers={"Authorization": f"Bearer {MASTER_KEY}"},
|
|
json={"key_alias": scratch.prefix},
|
|
)
|
|
assert resp.status_code == 200, resp.text
|
|
cleartext = resp.json()["key"]
|
|
assert cleartext.startswith("sk-")
|
|
|
|
hashed = hash_token(cleartext)
|
|
row = await prisma.db.litellm_verificationtoken.find_unique(where={"token": hashed})
|
|
assert row is not None
|
|
assert row.token == hashed != cleartext
|