Files
sisi/tests/test_e2e.py
T
swaitsandClaude Fable 5.2 2fc1fe9c2d
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.9) (push) Canceled after 0s
sisi 0.1.0: a shared rulebook and verification tool for AI coding agents
Contracts with a ladder of checks, an end-of-turn gate, retrospectives and
shared lessons, time-to-delivery measurement, a library of 140 verification
techniques and 20 recipes, personal data kept outside the clone, and
releases with rollback. Standard library only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 22:29:02 -07:00

38 lines
1.6 KiB
Python

import json, os, unittest
from support import *
class EndToEnd(SisiCase):
def test_full_flow(self):
for d in (".claude", ".codex", ".config/opencode"):
os.makedirs(os.path.join(self.home, d))
with open(os.path.join(self.home, ".claude", "settings.json"), "w") as f:
json.dump({"hooks": {"SessionStart": [{"matcher": "*", "hooks": [{"type": "command", "command": "existing"}]}]}}, f)
self.git_init()
self.assertEqual(self.sisi("install").returncode, 0)
doc = self.sisi("doctor").stdout
self.assertIn("claude-code wired", doc)
payload = json.dumps({"session_id": "e2e", "cwd": self.proj, "hook_event_name": "SessionStart", "source": "startup"})
self.assertEqual(self.sisi("tick", stdin=payload).stdout, "")
stop = json.dumps({"session_id": "e2e", "cwd": self.proj, "hook_event_name": "Stop", "stop_hook_active": False})
self.write_contract(contract([check("feature", "test -f %s/done.txt" % self.proj, rung=3)]))
r = self.sisi("gate", stdin=stop)
self.assertEqual(r.returncode, 0)
d = json.loads(r.stdout)
self.assertEqual(d["decision"], "block")
self.assertIn("feature", d["reason"])
open(os.path.join(self.proj, "done.txt"), "w").close()
r = self.sisi("gate", stdin=stop)
self.assertEqual((r.returncode, r.stdout), (0, ""))
out = self.sisi("status").stdout
self.assertIn("contracts verified : 1", out)
self.assertIn("3: 100%", out)
self.assertEqual(self.sisi("uninstall").returncode, 0)
if __name__ == "__main__":
unittest.main()