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:
@@ -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