diff --git a/tests/test_wheel_install.py b/tests/test_wheel_install.py index 306243e..75885b5 100644 --- a/tests/test_wheel_install.py +++ b/tests/test_wheel_install.py @@ -51,11 +51,15 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP venv_python = venv / "bin" / "python" run(["uv", "pip", "install", wheel, "--python", venv_python]) + pyproject_data = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")) + all_aliases = tuple(pyproject_data["project"]["scripts"].keys()) + for alias in all_aliases: + bin_path = venv / "bin" / alias + assert bin_path.exists(), f"entry point missing: {alias} at {bin_path}" + assert bin_path.stat().st_mode & 0o111, f"entry point not executable: {alias}" + interlocks_bin = venv / "bin" / "interlocks" il_bin = venv / "bin" / "il" - for bin_path in (interlocks_bin, il_bin): - assert bin_path.exists(), f"entry point missing at {bin_path}" - assert bin_path.stat().st_mode & 0o111, f"entry point not executable at {bin_path}" help_out = run([interlocks_bin, "help", "--advanced"]).stdout for expected in ("check", "ci", "pre-commit", "nightly"): @@ -71,6 +75,16 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP for cmd in version_cmds: assert run(cmd).stdout.strip() == version, cmd + # Verify bundled default configs ship inside the wheel and are resolvable + # via interlocks.defaults_path (importlib.resources) — the runtime mechanism + # used by every tool dispatch that lacks a project-native config. + bundled_probe = "\n".join([ + "from interlocks.defaults_path import path, TOOL_CONFIG_SPECS", + "for spec in TOOL_CONFIG_SPECS.values():", + " assert path(spec.filename).is_file(), f'bundled default missing: {spec.filename}'", + ]) + run([venv_python, "-c", bundled_probe]) + setup_project = tmp_path / "setup-project" setup_project.mkdir() (setup_project / "pyproject.toml").write_text(