Pin the replay's progress lines, its limit exit and the comparison without a miss in tests

This commit is contained in:
2026-11-12 06:03:31 +01:00
parent 2922d70a45
commit 4adcadcddb
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -273,10 +273,19 @@ class Main(unittest.TestCase):
"Without CLAUDE.md it found 1 of them, and missed 1 that it found both times with it:\n"
f" {self.checkout} 2026-10-14T10:00:00Z: 🔴 a.txt:1 wrong\n"
))
with_them = f"replaying 1 stability rounds with the instruction files on {REFERENCE}\n"
self.assertEqual(err, with_them * 2 + f"replaying 1 stability rounds without the instruction files on {REFERENCE}\n")
def test_without_claude_md_says_so_where_the_reviewer_missed_nothing_and_names_a_reviewer_that_printed_no_json(self):
code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]})
self.assertEqual((code, out.splitlines()[-1]), (0, "Without CLAUDE.md it found 1 of them, and missed 0 that it found both times with it."))
_, _, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}, review=lambda rung: [])
self.assertIn("found nothing: claude printed no json reply", err)
def test_without_claude_md_stops_at_a_usage_limit(self):
code, out, _ = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"type": "result", "api_error_status": 429, "result": "You've hit your limit"})
code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"type": "result", "api_error_status": 429, "result": "You've hit your limit"})
self.assertEqual((code, out), (1, ""))
self.assertIn("review-replay: claude hit a usage limit: You've hit your limit", err)
self.assertEqual(len(self.reviews), 1)
def test_replays_the_models_rounds_on_the_commit_reviewed_from_the_project_rung_down(self):
+1 -1
View File
@@ -27,7 +27,7 @@ class ReviewerContext(unittest.TestCase):
(self.home / ".claude" / "CLAUDE.md").write_text("## Prose\n\nWrite short.\n")
self.assertEqual(reviewer_context(self.home), Failure(f"{self.home / '.claude' / 'CLAUDE.md'} holds no section Shared goal, Vocabulary"))
(self.home / ".claude" / "CLAUDE.md").unlink()
self.assertIsInstance(reviewer_context(self.home), Failure)
self.assertIn(f"could not read {self.home / '.claude' / 'CLAUDE.md'}: ", reviewer_context(self.home).reason)
def test_the_repos_claude_md_holds_each_section(self):
headings = [line[3:] for line in (REPO / "CLAUDE.md").read_text().splitlines() if line.startswith("## ")]