From 29daccd96b04c88c71d485ee3b1bb827173b0fd6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 24 Sep 2026 22:18:30 +0200 Subject: [PATCH] Pin the archive path, the judge's third failure and the archive count in the tests --- bin/test_loop_claude.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 878ee579..f16d5181 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -60,7 +60,7 @@ class Project(unittest.TestCase): with unittest.mock.patch.dict(os.environ, {"HOME": "/h"}): with unittest.mock.patch("os.getcwd", return_value="/h/code/a/b"): self.assertEqual(loop.session_name(), "A ~/code/a/b auto-mode") - self.assertEqual(loop.project_path(), "code/a/b") + self.assertEqual(loop.project_path(), "a/b") with unittest.mock.patch("os.getcwd", return_value="/h/code"): self.assertEqual(loop.session_name(), "A ~/code auto-mode") self.assertEqual(loop.project_path(), "code") @@ -189,12 +189,15 @@ class RunRound(unittest.TestCase): with unittest.mock.patch.dict(os.environ, environment), unittest.mock.patch("time.sleep") as sleep: for _ in range(3): self.assertTrue(loop.run_round("task", "premises", "A name", SESSION_ID)) + open(verdicts, "w").write("fail fail fail") + with self.assertRaises(SystemExit): + loop.run_round("task", "premises", "A name", SESSION_ID) starts = [args[args.index("-p") + 1:][:3] for args in map(json.loads, open(calls)) if "--json-schema" not in args] - self.assertEqual([start[1] for start in starts], ["--name", "--resume", "--name"]) + self.assertEqual([start[1] for start in starts], ["--name", "--resume", "--name", "--resume"]) self.assertEqual(starts[1][2], SESSION_ID) - self.assertEqual(sleep.call_count, 1) + self.assertEqual(sleep.call_count, 3) self.assertEqual(open(verdicts).read(), "") - self.assertEqual(len(os.listdir(loop.ARCHIVE)), 1) + [copy] = [name for _, _, names in os.walk(loop.ARCHIVE) for name in names] class Reload(unittest.TestCase):