1913dbcc6e
改动内容:新增微信 code 换 openid 集成、/api/v1/auth/wechat-login 登录接口、微信用户创建/复用逻辑和测试覆盖。 验证方式:python -m pytest tests\\test_auth.py tests\\test_health.py -q 通过。
22 lines
683 B
Python
22 lines
683 B
Python
"""最小冒烟:服务能起、/health 通。"""
|
|
from __future__ import annotations
|
|
|
|
|
|
def test_health_ok(client) -> None:
|
|
resp = client.get("/health")
|
|
assert resp.status_code == 200
|
|
assert resp.json() == {"status": "ok"}
|
|
|
|
|
|
def test_openapi_loads(client) -> None:
|
|
resp = client.get("/openapi.json")
|
|
assert resp.status_code == 200
|
|
paths = resp.json()["paths"]
|
|
# auth endpoints 都注册了
|
|
assert "/api/v1/auth/jverify-login" in paths
|
|
assert "/api/v1/auth/wechat-login" in paths
|
|
assert "/api/v1/auth/sms/send" in paths
|
|
assert "/api/v1/auth/sms/login" in paths
|
|
assert "/api/v1/auth/refresh" in paths
|
|
assert "/api/v1/auth/me" in paths
|