"""The template a new driver starts from meets the standard as it is.""" from __future__ import annotations import pathlib import shutil from napalm_standard import ratchet from napalm_standard.check import check_repo TEMPLATE = pathlib.Path(__file__).resolve().parents[1] / "template" def test_the_template_passes_the_check() -> None: assert check_repo(TEMPLATE) == [] def test_the_template_is_within_its_ratchet(tmp_path: pathlib.Path) -> None: repo = tmp_path / "repo" shutil.copytree(TEMPLATE, repo) assert ratchet.run(repo, "napalm_example") == (0, "within the baseline") def test_the_template_ci_calls_the_shared_workflow() -> None: ci = (TEMPLATE / ".gitea" / "workflows" / "ci.yml").read_text() assert "uses: NAPALM/driver-standard/.gitea/workflows/driver.yml@" in ci assert "PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}" in ci