Files
planning-with-files/tests/test_script_permissions.py
T
OthmanAdi 1146688b3a release: v2.41.0 (Windows exec-bit skip + attestation-locking docs)
PR #167 (merged by @gauravvojha): test_script_permissions.py now carries a class-level pytest.mark.skipif for sys.platform == 'win32'. The two pre-existing Windows exec-bit failures (present since v2.34.1) skip cleanly on NTFS while still running on Linux and macOS. Post-merge repair: the upstream patch landed with a duplicate standalone function and a nested method inside it; the class-level skipif was re-applied, imports re-sorted, and the orphaned function removed, so test logic stays identical. Closes #166.

PR #168 (merged by @CleanDev-Fix): adds docs/attestation-locking.md, a new page covering the attest-plan.sh write path, atomic temp-rename guarantee, optional flock advisory lock, macOS Windows Git Bash WSL fallback table, and the slug-mode parallel workflow. Linked from the canonical SKILL.md Security Boundary section. Closes #165.

Version bumped to 2.41.0 across the 17 parity-locked files via scripts/bump-version.py. Tests: 130 pass, 2 skip, 0 fail.
2026-05-24 13:56:27 +02:00

34 lines
953 B
Python

import sys
import stat
import pytest
import unittest
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
SCRIPTS_DIR = REPO_ROOT / "skills" / "planning-with-files" / "scripts"
@pytest.mark.skipif(
sys.platform == "win32",
reason="Windows does not preserve POSIX executable bits",
)
class CanonicalScriptPermissionsTests(unittest.TestCase):
def assert_executable(self, path: Path) -> None:
mode = path.stat().st_mode
self.assertTrue(
mode & stat.S_IXUSR,
f"{path} is not executable (mode: {oct(mode)})",
)
def test_shell_scripts_are_executable(self) -> None:
self.assert_executable(SCRIPTS_DIR / "check-complete.sh")
self.assert_executable(SCRIPTS_DIR / "init-session.sh")
def test_session_catchup_is_executable(self) -> None:
self.assert_executable(SCRIPTS_DIR / "session-catchup.py")
if __name__ == "__main__":
unittest.main()