Answer stability round 1: 0 🔴, 1 🟡 (0 misread); split the re-rank into the pure rank_moves, rank only just before, as the item says, and name ranking in the README and the protocol
This commit is contained in:
@@ -91,12 +91,12 @@ class FakeJira:
|
||||
return {"id": "1", "key": key}
|
||||
|
||||
def ranked(self, body: object) -> object:
|
||||
"""Moves the one issue named just before or just after another, and answers no body, as Jira does for a rank it made."""
|
||||
"""Moves the issue the body names to just before the other issue it names, and answers no body, as Jira does for a rank it made."""
|
||||
assert isinstance(body, dict)
|
||||
[key], other = body["issues"], body.get("rankBeforeIssue") or body["rankAfterIssue"]
|
||||
[key], before = body["issues"], body["rankBeforeIssue"]
|
||||
moved = next(issue for issue in self.issues if issue["key"] == key)
|
||||
self.issues.remove(moved)
|
||||
self.issues.insert(next(place for place, issue in enumerate(self.issues) if issue["key"] == other) + ("rankAfterIssue" in body), moved)
|
||||
self.issues.insert(next(place for place, issue in enumerate(self.issues) if issue["key"] == before), moved)
|
||||
return None
|
||||
|
||||
def change(self, key: str, **fields: object) -> None:
|
||||
|
||||
Reference in New Issue
Block a user