mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 14:34:18 +08:00
feat(web): 品牌区显示应用版本号 — 新增 GET /api/v1/meta,前端启动拉取展示
This commit is contained in:
@@ -197,6 +197,28 @@ def test_realtime_router_endpoints():
|
||||
assert any("realtime" in p for p in paths)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Meta endpoint(WebUI 品牌区版本号展示)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_meta_endpoint_returns_version():
|
||||
"""GET /api/v1/meta 应返回 version 字段(已安装时为语义化版本)。"""
|
||||
pytest.importorskip("fastapi")
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from easy_tdx.web import create_app
|
||||
|
||||
client = TestClient(create_app())
|
||||
resp = client.get("/api/v1/meta")
|
||||
assert resp.status_code == 200
|
||||
body = resp.json()
|
||||
assert set(body.keys()) == {"version"}
|
||||
assert isinstance(body["version"], str)
|
||||
# 本测试环境下包已安装(pip install -e .),应能取到版本号
|
||||
assert body["version"] != ""
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 10: CLI serve command
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user