Datasets:
Download tests/test_templates.py from markedet/agent-templates: direct link, hf CLI and curl.
- Browser
- Download file 545 Bytes
-
https://huggingface.co/datasets/markedet/agent-templates/resolve/main/tests/test_templates.py
- Command line
-
hf download hf://datasets/markedet/agent-templates/tests/test_templates.py
-
curl -L -o test_templates.py https://huggingface.co/datasets/markedet/agent-templates/resolve/main/tests/test_templates.py
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)) | |