from pathlib import Path SKILL_DIR = Path(__file__).parents[1] / ".agents" / "skills" / "query-odps-data" def test_generic_skill_is_chinese_and_requires_catalog() -> None: skill = (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8") assert "# 通用 ODPS 数据查询" in skill assert "references/data-catalog.md" in skill assert "目录未收录的表或字段" in skill def test_catalog_covers_all_confirmed_tables() -> None: catalog = (SKILL_DIR / "references" / "data-catalog.md").read_text(encoding="utf-8") tables = { "loghubods.useractive_log", "loghubods.useractive_log_per5min", "loghubods.video_action_log_applet", "loghubods.video_action_log_flow", "loghubods.video_action_log_per5min", "loghubods.video_play_log", "loghubods.video_play_log_per5min", "loghubods.user_share_log", "loghubods.user_share_log_per5min", "loghubods.simpleevent_log", "loghubods.simpleevent_log_flow", "loghubods.ad_action_log_own", "loghubods.ad_action_log_own_per5min", "loghubods.operation_log_per5min", "videoods.dim_video", } assert all(f"`{table}`" in catalog for table in tables) assert "禁止改用物理列 `rootsessionid`" in catalog assert "未收录的字段不得按名称猜测含义" in catalog