feat: DSH编排基建首版(server/tests 88用例/P2插件/8020端口/PORT-NOTE/MOBILE_APP)

This commit is contained in:
2026-09-12 14:20:02 +08:00
commit f6acd20325
128 changed files with 24471 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
"""PWA static endpoints: /app shell, /sw.js, /manifest.webmanifest, /icon.svg."""
from __future__ import annotations
def test_sw_js_served(client):
r = client.get("/sw.js")
assert r.status_code == 200
assert "text/javascript" in r.headers["content-type"]
assert r.headers["cache-control"] == "no-cache"
assert "dsh-shell-v1" in r.text and "dsh-api-v1" in r.text
def test_manifest_served(client):
r = client.get("/manifest.webmanifest")
assert r.status_code == 200
assert "manifest+json" in r.headers["content-type"]
assert r.json()["start_url"] == "/app"
assert r.json()["icons"][0]["src"] == "/icon.svg"
def test_icon_served(client):
r = client.get("/icon.svg")
assert r.status_code == 200
assert "image/svg+xml" in r.headers["content-type"]
def test_app_shell_references_pwa_assets(client):
r = client.get("/app")
assert r.status_code == 200
body = r.text
assert "/manifest.webmanifest" in body
assert "serviceWorker" in body
assert "connect-card" in body # scan-to-connect card present in settings tab