Datasets:
Download tests/test_dataset.py from markedet/developer-free-tiers: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/markedet/developer-free-tiers/resolve/main/tests/test_dataset.py
- Command line
-
hf download hf://datasets/markedet/developer-free-tiers/tests/test_dataset.py
-
curl -L -o test_dataset.py https://huggingface.co/datasets/markedet/developer-free-tiers/resolve/main/tests/test_dataset.py
1.2 kB
| import pathlib, re, sys | |
| sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent / "tools")) | |
| import build | |
| RANKING = re.compile(r"\b(best|top|recommended|cheapest|winner|better|worse|great|ideal)\b", re.I) | |
| def test_rows_have_date_link_disclaimer(): | |
| fresh, _ = build.build("2026-10-25") | |
| assert fresh | |
| for r in fresh: | |
| assert r["source_url"].startswith("https://") and r["checked_on"] and r["disclaimer"] == build.DISCLAIMER | |
| def test_hold_rows_not_exported(): | |
| fresh, _ = build.build("2026-10-25") | |
| assert not {"Upstash", "Turso", "Deno"} & {r["provider"] for r in fresh} | |
| rows = build.yaml.safe_load((build.ROOT / "data" / "rows.yaml").read_text()) | |
| assert all(r["status"] == "publish" for r in rows) | |
| assert not {"Upstash", "Turso", "Deno"} & {r["provider"] for r in rows} | |
| def test_stale_after_30_days(): | |
| fresh, stale = build.build("2026-11-25") | |
| assert not fresh and stale | |
| build.build("2026-10-25") | |
| def test_no_recommendation_language_or_affiliate(): | |
| for r in build.build("2026-10-25")[0]: | |
| assert not RANKING.search(" ".join(r.values())) | |
| assert "ref=" not in r["source_url"] and "utm_" not in r["source_url"] | |