Skip to content

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

test: keep rendering checks in the product-site suite

zhifu gao53fbe89b652e
diff --git a/tests/test_vllm_model_source_docs.py b/tests/test_vllm_model_source_docs.py
index 12a349d56..ff54c0fe6 100644
--- a/tests/test_vllm_model_source_docs.py
+++ b/tests/test_vllm_model_source_docs.py
@@ -1,9 +1,7 @@
from pathlib import Path
import ast
-import importlib.util
import pytest
-from bs4 import BeautifulSoup
ROOT = Path(__file__).resolve().parents[1]
@@ -45,25 +43,6 @@ def test_model_selection_moss_alias_matches_real_service_configuration(suffix):
assert "verbose_json" in text
[email protected]("language", ["en", "zh"])
-def test_model_selection_renders_distinct_local_native_and_split_links(language):
- spec = importlib.util.spec_from_file_location(
- "model_choice_documentation", ROOT / "web-pages/product-site/documentation.py")
- documentation = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(documentation)
- catalogue = documentation.load_catalogue()
- entry = next(page for page in catalogue["pages"] if page["slug"] == "model-selection")
- rendered = documentation.render_source(entry, language, catalogue)
- soup = BeautifulSoup(rendered["content_html"], "html.parser")
- prefix = "/en" if language == "en" else ""
- targets = {a.get("href") for a in soup.select("a[href]")}
- for slug in ("vllm", "official-native-vllm", "native-vllm", "moss-transcribe-diarize"):
- assert f"{prefix}/docs/{slug}.html" in targets
- ids = [node["id"] for node in soup.select("[id]")]
- assert ids.count("vllm-checkpoint-paths") == 1
- assert len(ids) == len(set(ids)), "Existing and new section anchors must stay unique"
-
-
def test_documentation_hub_keeps_official_and_historical_native_entries_separate():
text = (ROOT / "docs/README.md").read_text()
for target in ("vllm_official_native_validation.md", "vllm_official_native_validation_zh.md",
diff --git a/web-pages/product-site/tests/test_documentation.py b/web-pages/product-site/tests/test_documentation.py
index 7f4dc8b11..b165b6746 100644
--- a/web-pages/product-site/tests/test_documentation.py
+++ b/web-pages/product-site/tests/test_documentation.py
@@ -140,6 +140,18 @@ def test_documentation_links_are_mapped_to_local_pages_or_repository(output):
assert href.startswith(('/', '#', 'https://', 'http://', 'mailto:')), href
[email protected]('prefix', ['', 'en/'])
+def test_model_selection_renders_distinct_local_native_and_split_links(output, prefix):
+ page = BeautifulSoup((output / prefix / 'docs/model-selection.html').read_text(), 'html.parser')
+ article = page.select_one('.docs-article')
+ targets = {a['href'] for a in article.select('a[href]')}
+ for slug in ('vllm', 'official-native-vllm', 'native-vllm', 'moss-transcribe-diarize'):
+ assert f'/{prefix}docs/{slug}.html' in targets
+ ids = [node['id'] for node in page.select('[id]')]
+ assert ids.count('vllm-checkpoint-paths') == 1
+ assert len(ids) == len(set(ids)), 'Existing and new section anchors must stay unique'
+
+
def test_source_fragment_links_keep_unicode_and_punctuation_boundaries(output):
for prefix in ('', 'en/'):
for path in (output / prefix / 'docs').glob('*.html'):