Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

test(site): align homepage patrol with product build (#3442)

zhifu gao90110b9d6be7
diff --git a/scripts/check_funasr_website_static.py b/scripts/check_funasr_website_static.py
index 43ba0b46f..bd2d57bda 100755
--- a/scripts/check_funasr_website_static.py
+++ b/scripts/check_funasr_website_static.py
@@ -41,7 +41,7 @@ class StaticAssetContract:
PAGE_CONTRACTS: dict[str, PageContract] = {
f"{BASE_URL}/": PageContract(
required=(
- "工业级",
+ "可私有化部署的语音智能基础设施",
"/v1/audio/transcriptions",
"vLLM",
"/donors.html",
@@ -49,7 +49,7 @@ PAGE_CONTRACTS: dict[str, PageContract] = {
),
f"{BASE_URL}/en/": PageContract(
required=(
- "Industrial Speech Recognition",
+ "Private-deployment speech infrastructure",
"OpenAI-compatible",
"/v1/audio/transcriptions",
"vLLM",
diff --git a/tests/test_check_funasr_website_static.py b/tests/test_check_funasr_website_static.py
index ccfaf7fa0..109bca1c6 100644
--- a/tests/test_check_funasr_website_static.py
+++ b/tests/test_check_funasr_website_static.py
@@ -18,18 +18,33 @@ def _load_module():
return module
+def _load_product_site_builder():
+ site_root = ROOT / "web-pages" / "product-site"
+ spec = importlib.util.spec_from_file_location(
+ "funasr_product_site_build", site_root / "build.py"
+ )
+ module = importlib.util.module_from_spec(spec)
+ sys.modules[spec.name] = module
+ sys.path.insert(0, str(site_root))
+ try:
+ spec.loader.exec_module(module)
+ finally:
+ sys.path.remove(str(site_root))
+ return module
+
+
def test_website_contract_accepts_current_public_copy():
checker = _load_module()
pages = {
"https://www.funasr.com/": """
- 工业级 语音识别服务
+ 可私有化部署的语音智能基础设施
/v1/audio/transcriptions
vLLM 加速
<a href="/donors.html">功德榜</a>
""",
"https://www.funasr.com/en/": """
- Industrial Speech Recognition
+ Private-deployment speech infrastructure
OpenAI-compatible
/v1/audio/transcriptions
vLLM Acceleration
@@ -234,6 +249,24 @@ def test_website_contract_accepts_current_public_copy():
assert checker.validate_pages(pages) == []
+def test_homepage_contract_accepts_current_product_site_build(tmp_path, monkeypatch):
+ checker = _load_module()
+ builder = _load_product_site_builder()
+ builder.build(tmp_path)
+ urls = ("https://www.funasr.com/", "https://www.funasr.com/en/")
+ pages = {
+ urls[0]: (tmp_path / "index.html").read_text(encoding="utf-8"),
+ urls[1]: (tmp_path / "en" / "index.html").read_text(encoding="utf-8"),
+ }
+ monkeypatch.setattr(
+ checker,
+ "PAGE_CONTRACTS",
+ {url: checker.PAGE_CONTRACTS[url] for url in urls},
+ )
+
+ assert checker.validate_pages(pages) == []
+
+
def test_website_contract_includes_homepage_entrypoints():
checker = _load_module()