feat(web): add duration efficiency rankings and about payload
This commit is contained in:
1 parent
519fc39fca
commit
5a656d42a8
4 files changed
+308
-10
No files matched your search
@@ -73,6 +73,10 @@ def test_readonly_routes_and_static():
|
||||
assert status == 200 and payload["ok"] is True
|
||||
status, _, payload = running.json("/api/system")
|
||||
assert status == 200 and payload["ok"] is True
|
||||
status, _, payload = running.json("/api/about")
|
||||
assert status == 200
|
||||
assert payload["data"]["schema_version"] == 4
|
||||
assert payload["data"]["analytics"]["min_duration_seconds"] == 600
|
||||
|
||||
status, _, overview = running.json("/api/overview")
|
||||
assert status == 200 and overview["ok"] is True
|
||||
@@ -94,7 +98,7 @@ def test_readonly_routes_and_static():
|
||||
assert status == 404
|
||||
|
||||
# 伪静态前端路由:直接访问 /rank、/video/... 返回 index.html
|
||||
for route_path in ("/rank", "/video/114775988111033", "/up/230020975", "/fans"):
|
||||
for route_path in ("/rank", "/videos", "/ups", "/about", "/video/114775988111033", "/up/230020975", "/fans"):
|
||||
status, route_headers, route_payload = running.request(route_path)
|
||||
assert status == 200, route_path
|
||||
assert "text/html" in route_headers["Content-Type"], route_path
|
||||
@@ -109,7 +113,7 @@ def test_readonly_routes_and_static():
|
||||
|
||||
status, _, payload = running.request("/api/ups")
|
||||
assert status == 200
|
||||
assert json.loads(payload)["data"]["sort"] == "avg_views"
|
||||
assert json.loads(payload)["data"]["sort"] == "efficiency"
|
||||
|
||||
status, _, payload = running.request("/api/fans?days=7&recent_days=14")
|
||||
assert status == 200
|
||||
|
||||
Reference in new issue
Block a user