From 1e4ffa5971c3fffaea0f22c4c297ec3fa34a3b3c Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 9 Nov 2026 14:23:41 -0500 Subject: [PATCH] Add self-host guard: template must reproduce repo config --- tests/test_selfhost.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/test_selfhost.py diff --git a/tests/test_selfhost.py b/tests/test_selfhost.py new file mode 100644 index 0000000..5f3fb02 --- /dev/null +++ b/tests/test_selfhost.py @@ -0,0 +1,15 @@ +"""Self-host test: rendering this repo's name reproduces its own config.""" + +from new_python.render import TEMPLATE_DIR, render + +REPO_ROOT = TEMPLATE_DIR.parent + + +def test_rendering_new_python_reproduces_the_repos_own_config(): + """The template must be this repo's own state, not a drifting copy.""" + files = render("new-python") + + for rel, content in files.items(): + own = REPO_ROOT / rel + assert own.is_file(), f"repo lacks its own {rel}" + assert content == own.read_text(), f"{rel} drifted from the template"