Test the Jira backend against answers of another kind and a filing's endless search

This commit is contained in:
2026-11-18 10:28:31 +01:00
parent 61ed465e99
commit 9d1d25218f
+3 -2
View File
@@ -119,7 +119,7 @@ class Jira(Case):
self.assertNotIn(("GET", ISSUE_TYPES), self.jira.calls)
def test_a_refused_filing_or_one_answered_without_a_key_says_the_issue_may_exist(self) -> None:
for answer, reason in ((Failure("Jira answered 503"), "cannot file the issue under ABC-12: Jira answered 503"), ({"id": "1"}, "Jira answered the new issue without an issue key")):
for answer, reason in ((Failure("Jira answered 503"), "cannot file the issue under ABC-12: Jira answered 503"), ({"id": "1"}, "Jira answered the new issue without an issue key"), (["ABC-100"], "Jira answered the new issue without an issue key")):
with self.subTest(answer=answer):
self.jira.answers[("POST", ISSUES)] = answer
self.assertEqual(self.new_store().file("ABC-12", "Count the runs.", "", ()), Failure(f"{reason}; unless Jira refused the request, the issue may exist: look under ABC-12 before filing it again"))
@@ -132,7 +132,7 @@ class Jira(Case):
def test_files_no_sub_task_where_the_project_has_no_sub_task_type_or_its_types_cannot_be_read(self) -> None:
store = self.new_store()
child = store.file("ABC-12", "Count the runs.", "", ())
for answer, reason in ((Failure("Jira answered 403"), "cannot read ABC's issue types: Jira answered 403"), ({"issueTypes": [{"id": "10001", "subtask": False}]}, "ABC has no sub-task issue type; turn sub-tasks on in Jira"), ({}, "ABC has no sub-task issue type; turn sub-tasks on in Jira")):
for answer, reason in ((Failure("Jira answered 403"), "cannot read ABC's issue types: Jira answered 403"), ({"issueTypes": [{"id": "10001", "subtask": False}]}, "ABC has no sub-task issue type; turn sub-tasks on in Jira"), ({}, "ABC has no sub-task issue type; turn sub-tasks on in Jira"), ([], "ABC has no sub-task issue type; turn sub-tasks on in Jira")):
with self.subTest(answer=answer):
self.jira.answers[("GET", ISSUE_TYPES)] = answer
self.assertEqual(store.file(str(child), "A task.", "", ()), Failure(reason))
@@ -168,6 +168,7 @@ class Jira(Case):
self.assertEqual(store.read(), Failure("the search for the sub-tasks of ABC-12's child issues did not end within 1 pages"))
store.file("ABC-12", "Count the runs.", "", ())
self.assertEqual(store.read(), Failure("the search for ABC-12's child issues did not end within 1 pages"))
self.assertEqual(store.file("ABC-12", "Count the runs.", "", ()), Failure("the search for ABC-12's child issues did not end within 1 pages"))
def test_an_epic_the_account_cannot_see_fails_the_read(self) -> None:
store = JiraEpic(Epic(SITE, "ABC-99"), self.env_file, self.jira, to_markdown, to_adf)