Answer stability round 2: 0 🔴, 1 🟡 (0 misread); let the in-memory store, which the dry run uses, take any transition to the first status asked for
This commit is contained in:
@@ -203,12 +203,6 @@ class EpicStoreContract:
|
||||
self.assertEqual([store.move_issue_by(task, self.transition, ("Done",)), store.move_issue_by(child, self.transition, ("Done",))], ["Done", "Done"])
|
||||
self.assertEqual({issue.key: (issue.status, issue.done) for issue in self.issues(store)}, {child: ("Done", True), task: ("Done", True)})
|
||||
|
||||
def test_makes_no_move_by_a_transition_that_leads_to_another_status_than_those_asked_for(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
self.assertIsInstance(store.move_issue_by(child, self.transition, ("Release Ready",)), Failure)
|
||||
self.assertEqual([(issue.status, issue.done) for issue in self.issues(store)], [("To Do", False)])
|
||||
|
||||
def test_leaves_an_issue_already_at_a_status_asked_for_where_it_is(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
|
||||
@@ -127,20 +127,17 @@ class MemoryEpic:
|
||||
return None
|
||||
|
||||
def move_issue_by(self, key: str, transition: str, to: tuple[str, ...]) -> str | Failure:
|
||||
# The fake holds no workflow: a transition leads to the status of its own name.
|
||||
# The fake holds no workflow, so it cannot tell where a transition leads: each leads to the first status asked for.
|
||||
if self.fails:
|
||||
return Failure(self.fails)
|
||||
issue = self.within(key)
|
||||
if issue is None:
|
||||
return no_child(self.epic_key, key, "moved")
|
||||
accepted = {name.casefold() for name in to}
|
||||
if issue.status.casefold() in accepted:
|
||||
if issue.status.casefold() in {name.casefold() for name in to}:
|
||||
return issue.status
|
||||
if transition.casefold() not in accepted:
|
||||
return Failure(f"the transition {transition!r} leads {key} to the status {transition!r}, not to {' or '.join(repr(name) for name in to)}")
|
||||
self.change(key, status=transition, done=transition.casefold() == "done")
|
||||
self.change(key, status=to[0], done=to[0].casefold() == "done")
|
||||
self.writes.append(f"move {key} by {transition}")
|
||||
return transition
|
||||
return to[0]
|
||||
|
||||
def finish_issue(self, key: str) -> None | Failure:
|
||||
if self.fails:
|
||||
|
||||
Reference in New Issue
Block a user