test: cover ai platform demo workflow

This commit is contained in:
hailin
2026-07-14 14:11:31 +08:00
parent d08dda723c
commit 77def70983
6 changed files with 142 additions and 3 deletions

View File

@@ -47,6 +47,16 @@ def test_admin_manages_provider_without_exposing_secret(client, db):
provider.refresh_from_db()
assert decrypt_secret(provider.api_key_encrypted) == "sk-secret-1234"
replaced = client.patch(
f"/api/modelhub/providers/{provider.id}",
data={"api_key": "sk-new-secret-5678"},
content_type="application/json",
)
assert replaced.status_code == 200
provider.refresh_from_db()
assert decrypt_secret(provider.api_key_encrypted) == "sk-new-secret-5678"
assert replaced.json()["credential_masked"] == "****5678"
def test_model_test_runs_through_recorded_invocation(client, db, monkeypatch):
login_admin(client)