21 lines
709 B
Python
21 lines
709 B
Python
"""应用市场场景分类器回归(稳定模块,无外部依赖)。
|
|
|
|
仅校验分类法结构本身不被破坏;不调用 _classify_scene(其内部会请求 LLM)。
|
|
分类法是前端筛选/徽章的数据源,结构回归会导致全站分类错乱。
|
|
"""
|
|
from app.api.market import MARKET_SCENES
|
|
|
|
|
|
def test_market_scenes_is_14_flat():
|
|
assert len(MARKET_SCENES) == 14
|
|
|
|
|
|
def test_market_scenes_unique_ids_and_required_keys():
|
|
ids = [s["id"] for s in MARKET_SCENES]
|
|
assert len(set(ids)) == 14 # 无重复 id
|
|
for s in MARKET_SCENES:
|
|
assert "id" in s
|
|
assert "label" in s
|
|
assert "desc" in s
|
|
assert isinstance(s["label"], str) and s["label"].strip()
|