Test the unmarked cited item's message and the file a non-UTF-8 read names

This commit is contained in:
2026-11-13 03:23:27 +01:00
parent ee241646e7
commit 45ecf0798e
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -182,6 +182,13 @@ class PrepareScoring(unittest.TestCase):
junior = (self.root / ".local" / "state" / "larv-review" / "proj" / "scoring" / "junior-a.md").read_text()
self.assertIn("from a DIFFERENT version (main): `CLAUDE.md` and `AGENTS.md`, which it imports.", junior)
def test_names_a_file_that_is_not_utf_8(self):
(self.root / ".claude").mkdir()
(self.root / ".claude" / "CLAUDE.md").write_bytes(b"\xff")
with self.assertRaises(OSError) as raised:
preloaded_files(self.checkout, self.root)
self.assertEqual(str(raised.exception), f"{self.root}/.claude/CLAUDE.md: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte")
def test_leaves_out_a_claude_md_the_project_settings_exclude(self):
(self.root / ".claude").mkdir()
(self.root / ".claude" / "CLAUDE.md").write_text("# Home\n")
+2
View File
@@ -145,6 +145,8 @@ class Rank(unittest.TestCase):
self.assertIsInstance(self.ranked(decisions=DECISIONS + "Until `todo.md` item 4 lands.\n"), ranking.Ranked)
gone = self.ranked(TODO.replace("| 5 | 0.1.0 | | decision | **Move the writes out.** | 1 | 1 | 4 | 5 | 5 | 2.1 by 1 | 0 |\n", ""))
self.assertEqual(gone.reason, "docs/decisions.md cites \"`todo.md` item 5\", which todo.md no longer holds; revise that decision to say what holds now")
unmarked = self.ranked(TODO.replace("| 5 | 0.1.0 | | decision |", "| 5 | 0.1.0 | | |"))
self.assertEqual(unmarked.reason, "docs/decisions.md cites \"`todo.md` item 5\"; mark it decision, or another reason the bar does not apply")
def test_names_each_item_under_the_bar_that_is_not_exempt(self):
ranked = self.ranked(TODO.replace("`Bar = 2`", "`Bar = 3.5`"))