mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-27 23:28:03 +09:00
One-click PowerShell entry point that spins up Ubuntu/Debian VMs in parallel, installs ServerKit from the local working tree (not origin/main), runs a pytest API harness against the live panel, and aggregates results into a self-contained HTML report. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
938 B
Python
30 lines
938 B
Python
def test_setup_status_endpoint(http, base_url):
|
|
r = http.get(f"{base_url}/api/v1/auth/setup-status", timeout=10)
|
|
assert r.status_code == 200, r.text
|
|
body = r.json()
|
|
assert "needs_setup" in body, body
|
|
|
|
|
|
def test_admin_register_and_login(admin_token, http, base_url, admin_credentials):
|
|
# admin_token fixture already did the register; verify login works too
|
|
assert admin_token, "no token from register"
|
|
r = http.post(
|
|
f"{base_url}/api/v1/auth/login",
|
|
json={
|
|
"email": admin_credentials["email"],
|
|
"password": admin_credentials["password"],
|
|
},
|
|
timeout=10,
|
|
)
|
|
assert r.status_code == 200, r.text
|
|
assert "access_token" in r.json()
|
|
|
|
|
|
def test_authed_request(http, base_url, auth_headers):
|
|
r = http.get(
|
|
f"{base_url}/api/v1/auth/setup-status",
|
|
headers=auth_headers,
|
|
timeout=10,
|
|
)
|
|
assert r.status_code == 200, r.text
|