From 9ab4dfc6a4b86601bf31ec8537f6a92d5da77fe9 Mon Sep 17 00:00:00 2001 From: guke Date: Mon, 29 Jun 2026 16:23:07 +0800 Subject: [PATCH] =?UTF-8?q?test(h5):=20=E9=A6=96=E9=A1=B5=E6=89=98?= =?UTF-8?q?=E7=AE=A1=20+=20=E7=B4=A0=E6=9D=90=E5=86=92=E7=83=9F(6=20passed?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/test_h5_hosting.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_h5_hosting.py b/tests/test_h5_hosting.py index 1acd149..bfd68ad 100644 --- a/tests/test_h5_hosting.py +++ b/tests/test_h5_hosting.py @@ -30,3 +30,20 @@ def test_h5_records_served_and_migrated(client) -> None: assert "NativeBridge" not in body # 旧桥名清零 assert "getApiBase" not in body # 同源:绝对地址拼接已移除 assert "../shared/bridge.js" in body + + +def test_h5_home_served(client) -> None: + resp = client.get("/h5/home/index.html") + assert resp.status_code == 200 + assert resp.headers.get("cache-control") == "no-cache" + body = resp.text + assert 'id="home"' in body + assert "data-cc-id" not in body # 原型编辑器留痕已剥 + assert "../../assets/" not in body # 素材路径已本地化 + assert "/api/v1/platform/stats" in body # 已接同源数据 + assert body.count('class="screen') == 1 # 只剩首页一屏 + + +def test_h5_home_asset_served(client) -> None: + resp = client.get("/h5/home/assets/shared/logos/sb-brand.png") + assert resp.status_code == 200