Kill the surviving mutants of the finish moves: the fake's status and refusal, an unreadable epic, and one more split item per finish

This commit is contained in:
2026-11-19 01:20:30 +01:00
parent e946d71a5e
commit 4cc39b8b20
4 changed files with 38 additions and 8 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ def done_transition(offered: object, key: str, named: str | None) -> str | Failu
if len(chosen) == 1:
return chosen[0][0]
listed = " and ".join(f"{name!r} to {status!r}" for _, name, status in closing)
if len(closing) > 1 and not named:
if closing and not named:
return Failure(f"{key}'s status has more than one transition to a done status, {listed}: name the one to use in `{JIRA_FINISH_TRANSITION}`, in ~/.claude-projects/do-epic/config.toml")
if closing:
return Failure(f"{key}'s status has no transition called {named!r} to a done status, only {listed}: correct `{JIRA_FINISH_TRANSITION}`, in ~/.claude-projects/do-epic/config.toml")
+14
View File
@@ -51,5 +51,19 @@ class Ranking(unittest.TestCase):
self.assertEqual(store.rank(str(child), "ZZZ-1"), Failure(f"ZZZ-1 is not one of the child issues of the epic ABC-12, so {child} is not ranked"))
class Finishing(unittest.TestCase):
def test_finishes_an_issue_to_the_status_done(self) -> None:
store = MemoryEpic("ABC-12")
key = store.file("ABC-12", "Count the runs.", "", ())
self.assertIsNone(store.finish(str(key)))
self.assertEqual([(issue.status, issue.done) for issue in store.issues], [("Done", True)])
def test_refuses_to_finish_an_issue_outside_the_epic_saying_so(self) -> None:
self.assertEqual(MemoryEpic("ABC-12").finish("ZZZ-1"), Failure("ZZZ-1 is not one of the child issues of the epic ABC-12, so it cannot be finished"))
def test_fails_to_finish_with_the_reason_given(self) -> None:
self.assertEqual(MemoryEpic("ABC-12", fails="Jira is down").finish("ABC-100"), Failure("Jira is down"))
if __name__ == "__main__":
unittest.main()