From 9d1d25218f05b412a2896245e417af38636ce3b6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 10:28:31 +0100 Subject: [PATCH] Test the Jira backend against answers of another kind and a filing's endless search --- bin/do_epic/backend/test_jira.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/do_epic/backend/test_jira.py b/bin/do_epic/backend/test_jira.py index abe74cf8..6c9436aa 100644 --- a/bin/do_epic/backend/test_jira.py +++ b/bin/do_epic/backend/test_jira.py @@ -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)