|
|
|
@@ -348,14 +348,18 @@ class Jira(Case):
|
|
|
|
|
({("GET", f"{ISSUES}/{key}?fields=assignee,status"): {"fields": {"assignee": None}}}, f"{key} is not in the shape Jira Cloud's REST API version 3 documents: KeyError('status')"),
|
|
|
|
|
({("GET", MYSELF): Failure("Jira answered 503")}, f"cannot read which account do-epic works as, to assign {key}: Jira answered 503"),
|
|
|
|
|
({("GET", MYSELF): {"displayName": "Do Epic"}}, f"cannot assign {key}: Jira named no account ID for the account do-epic works as"),
|
|
|
|
|
({("GET", MYSELF): ["Do Epic"]}, f"cannot assign {key}: Jira named no account ID for the account do-epic works as"),
|
|
|
|
|
({("PUT", assignee): Failure("Jira answered 403")}, f"cannot assign {key}: Jira answered 403"),
|
|
|
|
|
({("GET", transitions): Failure("Jira answered 503")}, f"cannot read {key}'s transitions: Jira answered 503"),
|
|
|
|
|
({("GET", transitions): {"transitions": [{"id": "21"}]}}, f"Jira answered {key}'s transitions in a shape other than the one it documents"),
|
|
|
|
|
({("GET", transitions): {"transitions": [{"id": "31", "name": "Mark as done", "to": DONE}]}}, f"{key} has no transition 'Start' from its status 'To Do', only 'Mark as done' to 'Done': name in `jira-start-transition` one that its statuses before work starts have"),
|
|
|
|
|
({("GET", transitions): {"transitions": [{"id": "31", "name": "Mark as done", "to": DONE}, {"id": "41", "name": "Wait", "to": TO_DO}]}}, f"{key} has no transition 'Start' from its status 'To Do', only 'Mark as done' to 'Done' and 'Wait' to 'To Do': name in `jira-start-transition` one that its statuses before work starts have"),
|
|
|
|
|
({("GET", transitions): {"transitions": []}}, f"{key} has no transition 'Start' from its status 'To Do', nor any other the account may make"),
|
|
|
|
|
({("POST", transitions): Failure("Jira answered 400")}, f"cannot move {key} by 'Start': Jira answered 400"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): Failure("Jira answered 400")}, f"cannot read the active sprint of board 6, which `jira-sprint-board` names: Jira answered 400"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): {"values": [{"name": "Sprint 9"}]}}, "Jira answered board 6's sprints in a shape other than the one it documents"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): [{"id": 77}]}, "Jira answered board 6's sprints in a shape other than the one it documents"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): {"values": "Sprint 9"}}, "Jira answered board 6's sprints in a shape other than the one it documents"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): {"values": []}}, f"board 6, which `jira-sprint-board` names, has no active sprint, so {key} joins none"),
|
|
|
|
|
({("GET", ACTIVE_SPRINTS): {"values": [{"id": 77}, {"id": 78}]}}, f"board 6, which `jira-sprint-board` names, has 2 active sprints, so {key} joins none"),
|
|
|
|
|
({("POST", SPRINT_ISSUES): Failure("Jira answered 403")}, f"cannot add {key} to the active sprint of board 6: Jira answered 403"),
|
|
|
|
@@ -369,6 +373,18 @@ class Jira(Case):
|
|
|
|
|
store.start_issue(key)
|
|
|
|
|
self.assertEqual((self.jira.issues[0]["fields"]["status"], self.jira.sprinted), (IN_PROGRESS, [[key]])) # type: ignore[index]
|
|
|
|
|
|
|
|
|
|
def test_a_start_whose_issue_or_parent_jira_cannot_read_or_that_the_epic_does_not_hold_says_which(self) -> None:
|
|
|
|
|
store = self.starting()
|
|
|
|
|
child = store.file("ABC-12", "Count the runs.", "", ())
|
|
|
|
|
task = store.file(child, "Count them in the api.", "", ())
|
|
|
|
|
self.jira.issues.append({"key": "ABC-61", "fields": {"summary": "Other.", "description": None, "labels": [], "assignee": None, "status": TO_DO, "parent": None, "issuelinks": []}})
|
|
|
|
|
self.assertEqual(store.start_issue("ABC-61"), Failure("ABC-61 is not one of the child issues of the epic ABC-12, so it cannot be started"))
|
|
|
|
|
self.jira.answers[("GET", f"{ISSUES}/{task}?fields=parent,status")] = Failure("Jira answered 503")
|
|
|
|
|
self.assertEqual(store.start_issue(task), Failure(f"cannot read {task} to start it: Jira answered 503"))
|
|
|
|
|
del self.jira.answers[("GET", f"{ISSUES}/{task}?fields=parent,status")]
|
|
|
|
|
self.jira.answers[("GET", f"{ISSUES}/{child}?fields=parent,status")] = Failure("Jira answered 503")
|
|
|
|
|
self.assertEqual(store.start_issue(task), Failure(f"cannot read {child} to start its sub-task: Jira answered 503"))
|
|
|
|
|
|
|
|
|
|
def test_finishes_an_issue_by_the_transition_the_settings_name(self) -> None:
|
|
|
|
|
store = self.new_store()
|
|
|
|
|
key = store.file("ABC-12", "Count the runs.", "", ())
|
|
|
|
|