| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- from pathlib import Path
- PROJECT = Path(__file__).parents[1]
- SKILL_DIR = PROJECT / ".agents" / "skills" / "odps-product-efficiency-report"
- def test_return_attribution_fields_are_explicit() -> None:
- contract = "\n".join(
- [
- (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8"),
- (SKILL_DIR / "references" / "metrics.md").read_text(encoding="utf-8"),
- (SKILL_DIR / "references" / "raw-output-contract.md").read_text(encoding="utf-8"),
- ]
- )
- assert "topic='share'" in contract
- assert "topic='click'" in contract
- assert "type='share'" in contract
- assert "Never use `type='share'`" in contract
- def test_generic_catalog_uses_topic_for_return_chain() -> None:
- catalog = (
- PROJECT / ".agents" / "skills" / "query-odps-data" / "references" / "data-catalog.md"
- ).read_text(encoding="utf-8")
- assert "源分享使用 `topic='share'`" in catalog
- assert "点击使用 `topic='click'`" in catalog
- assert "禁止用 `type='share'` 判断源分享" in catalog
- def test_realtime_total_only_contract_is_explicit() -> None:
- skill = (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8")
- raw_contract = (SKILL_DIR / "references" / "raw-output-contract.md").read_text(
- encoding="utf-8"
- )
- assert "仅全量" in skill
- assert "`dt LIKE 'yyyyMMdd%'`" in skill
- assert "Overall-only variant" in raw_contract
- assert "do not run the 16-bucket formatter" in raw_contract
|