agent-templates / tests /test_templates.py
markedet's picture
Add license files and NOTICE, update license fields
a91f511 verified
Raw History Blame Contribute Delete
545 Bytes
import pathlib, re
ROOT = pathlib.Path(__file__).resolve().parent.parent
FILES = sorted((ROOT / "templates").rglob("*.md"))
CLAIMS = re.compile(r"\b(safe|safely|secure|security|guarantee\w*|certified|approved|verified|best practice)\b", re.I)
def test_thirty_templates():
assert len(FILES) == 30
def test_every_template_has_license_header_and_no_claims():
for f in FILES:
t = f.read_text()
assert "CC BY 4.0" in t and "as is, no warranties" in t, f
assert not CLAIMS.search(t), (f, CLAIMS.search(t).group(0))