Archived
test: golden 快照切换到 React 构建产物口径
为什么:首页响应源从 Jinja2 渲染模板(去尾换行)变为 frontend/dist/index.html 原样字节,html_len/位移到 967 字节。 快照以固定产物名重建,docstring 同步更新口径说明。
This commit is contained in:
1 parent
58853abd3c
commit
17b4a99680
2 files changed
+6
-6
No files matched your search
@@ -534,7 +534,7 @@
|
||||
"payload": null,
|
||||
"status": 200,
|
||||
"body": null,
|
||||
"html_len": 466913,
|
||||
"html_sha256": "78cbb4b1f627700c0537840d20e2ebb5bd344efe05a309bef541cfaf63efb493"
|
||||
"html_len": 967,
|
||||
"html_sha256": "20192cdbbd32718dface7353eb1c8b08b27aa83ede70b3afb014908b0d93254a"
|
||||
}
|
||||
]
|
||||
@@ -8,10 +8,10 @@ tests/golden/responses.json 是**删除 Flask 之前**从 Flask 应用捕获的
|
||||
说明:
|
||||
- 会话 Cookie 在运行时用当前库的 login_seq 动态构造(快照不存 Cookie)。
|
||||
- 请求为只读/确定性调用,不含实时上游数据(那些由 parity/单测覆盖)。
|
||||
- `index` 条目的 html_len/html_sha256 记的是**当前模板**渲染结果,不是 Flask 期数值
|
||||
(该条目 body 为 null)。有意改模板后必须同步刷新这两项:
|
||||
服务端渲染 = templates/index.html 去掉末尾换行,故
|
||||
html_len = 文件字节数 - 1,html_sha256 = sha256(文件去掉末尾换行)。
|
||||
- `index` 条目的 html_len/html_sha256 记的是**当前前端**的首页产物,不是 Flask 期数值
|
||||
(该条目 body 为 null)。有意改前端后必须同步刷新这两项:
|
||||
首页现服务 React 构建产物 frontend/dist/index.html(vite 固定产物文件名,
|
||||
字节级稳定),html_len = 文件字节数,html_sha256 = sha256(文件字节)。
|
||||
"""
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
Reference in new issue
Block a user