Title each decision by what holds now, and make the small fixes filed against bin/, the README, .gitignore and stability-reviewer
This commit is contained in:
+14
-1
@@ -5,6 +5,7 @@ import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
|
||||
@@ -13,7 +14,7 @@ from loop_claude.claude_code import formats, transcript
|
||||
from loop_claude.cycle import judge
|
||||
from loop_claude.loop import main, reload
|
||||
from loop_claude.outcome import Failure, Stop
|
||||
from loop_claude.project import premises
|
||||
from loop_claude.project import checkout, premises
|
||||
|
||||
CWD = pathlib.Path("/c")
|
||||
|
||||
@@ -133,6 +134,18 @@ class LoopState(unittest.TestCase):
|
||||
self.assertEqual(reload.decode_state('{"count": 1, "name": "n"}', Stringly), Stringly(1, "n"))
|
||||
self.assertIsNone(reload.decode_state('{"count": "1", "name": "n"}', Stringly))
|
||||
|
||||
def test_stops_when_the_reload_cannot_start_python(self):
|
||||
with tempfile.TemporaryDirectory() as root, mock.patch("os.execv", side_effect=OSError(2, "No such file or directory")):
|
||||
launcher = pathlib.Path(root, "loop-claude")
|
||||
launcher.write_text("")
|
||||
self.assertEqual(reload.exec_if_edited(launcher, "stale", main.LoopState(1, "/r", "do it")), Stop(1, "could not reload loop-claude: No such file or directory; rerun loop-claude <task>"))
|
||||
|
||||
|
||||
class Checkouts(unittest.TestCase):
|
||||
def test_lists_the_root_alone_when_git_cannot_start(self):
|
||||
with tempfile.TemporaryDirectory() as empty, mock.patch.dict(os.environ, {"PATH": empty}):
|
||||
self.assertEqual(checkout.checkouts(empty), [empty])
|
||||
|
||||
|
||||
|
||||
class ReplaceFile(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user