This commit is contained in:
@@ -48,6 +48,7 @@ class MemoryEpic:
|
||||
if child is None:
|
||||
return no_child(self.epic_key, key, "labelled")
|
||||
self.change(key, labels=tuple(sorted({*child.labels, label})))
|
||||
self.writes.append(f"label {key} with {label}")
|
||||
return None
|
||||
|
||||
def rank(self, key: str, before: str) -> None | Failure:
|
||||
|
||||
@@ -70,6 +70,23 @@ class TheEpicItCopies(unittest.TestCase):
|
||||
self.assertEqual((real.writes, [each.key for each in real.issues]), ([], ["ABC-20", "ABC-21"]))
|
||||
self.assertEqual(copy.writes, ["file ABC-new1 under ABC-20: A", "file ABC-new2 under ABC-20: B"])
|
||||
|
||||
def test_notes_each_kind_of_write_in_order(self) -> None:
|
||||
epic = MemoryEpic("ABC-12", [issue("ABC-20"), issue("ABC-21")])
|
||||
epic.file("ABC-20", "Sub", "d", ("repo:api",), "ABC-21")
|
||||
epic.add_label("ABC-21", "do-epic-claude")
|
||||
epic.rank("ABC-21", "ABC-20")
|
||||
epic.comment("ABC-20", " Why. ")
|
||||
epic.finish_issue("ABC-21")
|
||||
epic.close("All done")
|
||||
self.assertEqual(epic.writes, ["file ABC-102 under ABC-20: Sub, labelled repo:api, blocked by ABC-21", "label ABC-21 with do-epic-claude", "rank ABC-21 before ABC-20", "comment on ABC-20: Why.", "finish ABC-21", "close the epic: All done"])
|
||||
|
||||
def test_notes_no_write_that_fails(self) -> None:
|
||||
epic = MemoryEpic("ABC-12", [issue("ABC-20")])
|
||||
epic.add_label("ABC-99", "x")
|
||||
epic.comment("ABC-20", " ")
|
||||
epic.finish_issue("ABC-99")
|
||||
self.assertEqual(epic.writes, [])
|
||||
|
||||
def test_fails_where_the_real_epic_cannot_be_read(self) -> None:
|
||||
self.assertEqual(dry_run.seeded(MemoryEpic("ABC-12", [], fails="Jira answered 503")), Failure("Jira answered 503"))
|
||||
|
||||
|
||||
@@ -992,6 +992,12 @@ class TheDryRun(DoEpicTest):
|
||||
changing = {"new-session", "new-window", "kill-window", "set-option", "rename-window"}
|
||||
self.assertEqual([args for args in fake.tmux_calls if args[0] in changing], [])
|
||||
|
||||
def test_prints_the_label_a_pick_would_give_an_issue(self) -> None:
|
||||
self.issues = [issue("ABC-20")]
|
||||
code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(claude=[structured({"parts": []}), structured({"pick": "claude"})]))
|
||||
self.assertEqual(code, 0)
|
||||
self.assertIn("planning would write to Jira:\n- label ABC-20 with do-epic-claude\nwould start ABC-20\n", out.replace("<1790000000> ", ""))
|
||||
|
||||
def test_counts_the_chunks_it_would_start_against_the_epics_cap_and_a_repos_limit(self) -> None:
|
||||
self.issues = [issue("ABC-21", "do-epic-claude"), issue("ABC-22", "do-epic-claude"), issue("ABC-23", "do-epic-claude")]
|
||||
self.description = DESCRIPTION.replace("2", "1")
|
||||
|
||||
Reference in New Issue
Block a user