From ad6118d19ffb29db42464daa888944f9c6f729a5 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 13 Nov 2026 00:11:52 +0100 Subject: [PATCH] Hold the reworded goals-file and todo.md failure messages to their exact text --- bin/release_plan/test_ranking.py | 4 ++++ bin/test_rank_todo.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bin/release_plan/test_ranking.py b/bin/release_plan/test_ranking.py index 0d598807..c8888de8 100644 --- a/bin/release_plan/test_ranking.py +++ b/bin/release_plan/test_ranking.py @@ -159,6 +159,10 @@ class Rank(unittest.TestCase): self.assertEqual(ranking.readme_goals(README.replace(" 1.", "\t1.")), [("1", "Achieve"), ("2", "Maintain"), ("2.1", "Achieve")]) self.assertEqual(ranking.readme_goals(README.replace("2. **Maintain:** Correct.", "```\n## Goals\n```\n2. Correct.")), [("1", "Achieve"), ("2", None), ("2.1", "Achieve")]) self.assertEqual(ranking.readme_goals(README.replace("2. **Maintain:**", "1. **Maintain:**")), Failure("the goals file's ## Goals numbers 1, 1, 1.1; number each goal by its position")) + self.assertEqual(ranking.parse_weights(["| Goal | W |", "|---|---|"], ["1"]), Failure("the goal weights list no goal, but the goals file's goals are 1; by position they weigh:\n| Goal | W |\n|---|---|\n| 1 | 1.00 |")) + self.assertEqual(ranking.readme_goals("# P\n"), Failure("the goals file has ## Goals 0 times; it needs it once")) + self.assertEqual(ranking.readme_goals("## Goals\n\nFast.\n"), Failure("the goals file's ## Goals has no numbered goal")) + self.assertEqual(ranking.parse_weights(["| Goal | W |", "|---|---|", "| 1 | 0.5 |", "| 3 | 0.5 |"], ["1", "2"]), Failure("the goal weights list 1, 3, but the goals file's goals are 1, 2; by position they weigh:\n| Goal | W |\n|---|---|\n| 1 | 1.00 |\n| 2 | 0.50 |")) self.assertEqual(ranking.readme_goals("## Goals\n\n1. **Achieve:** A.\n 1. **Achieve:** B.\n\t2. **Achieve:** C.\n"), [("1", "Achieve"), ("1.1", "Achieve"), ("1.2", "Achieve")]) def test_refuses_a_goal_it_cannot_weigh(self): diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 0bccd788..71d68950 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -35,6 +35,8 @@ class Main(unittest.TestCase): self.assertEqual(self.run_main(str(todo)), (1, f"{temp}/README.md: not UTF-8\n")) pathlib.Path(temp, "README.md").unlink() self.assertEqual(self.run_main(str(todo)), (1, f"{temp}/README.md: not found; rank_todo.py weighs goals from the file the project's config names as goals-and-audience\n")) + todo.unlink() + self.assertEqual(self.run_main(str(todo)), (1, f"{todo}: not found; every project keeps a todo.md, and rank_todo.py --help shows one\n")) def test_writes_the_ranked_file_yet_fails_on_an_item_under_the_bar(self): under = "item 2 scores 3.1, under the bar 4; delete it, or mark it with a reason the bar does not apply"