Answer stability round 1: 0 🔴, 3 🟡 (0 misread); read the issue types in one place, skip the epic type, and say what todo-item add files

This commit is contained in:
Lilleman
2026-11-20 13:40:07 +01:00
parent 98d1fc1eba
commit 3d3f8c9a66
7 changed files with 51 additions and 37 deletions
+13 -9
View File
@@ -71,7 +71,7 @@ class TheCategoryOfAnIssuesStatus(unittest.TestCase):
class TheRefusalOfAnIssueType(unittest.TestCase):
TYPES = {"issueTypes": [{"name": "Feature", "subtask": False}, {"name": "Bug", "subtask": False}, {"name": "Subtask", "subtask": True}]}
TYPES = {"issueTypes": [{"name": "Feature", "subtask": False, "hierarchyLevel": 0}, {"name": "Bug", "subtask": False, "hierarchyLevel": 0}, {"name": "Epic", "subtask": False, "hierarchyLevel": 1}, {"name": "Subtask", "subtask": True, "hierarchyLevel": -1}]}
def refusal(self, kind: str, answer: object) -> str | None:
asked: list[tuple[str, str, object]] = []
@@ -80,24 +80,28 @@ class TheRefusalOfAnIssueType(unittest.TestCase):
asked.append((method, url, body))
return answer
refused = jira.issue_type_refusal("https://acme.atlassian.net", "ABC", kind, "Basic x", http)
refused = jira.issue_type_refusal("https://acme.atlassian.net", "ABC", kind, "jira-finding-type", "Basic x", http)
self.assertEqual(asked, [("GET", "https://acme.atlassian.net/rest/api/3/issue/createmeta/ABC/issuetypes", None)])
return refused
def test_is_none_where_the_project_has_the_type(self):
self.assertIsNone(self.refusal("Bug", self.TYPES))
def test_names_the_types_the_project_has_other_than_sub_tasks_where_it_lacks_the_type(self):
self.assertEqual(self.refusal("Task", self.TYPES), "ABC has no issue type 'Task' to file an issue under an epic as; its types are Feature and Bug")
def test_names_the_types_the_project_has_and_the_setting_where_it_lacks_the_type(self):
self.assertEqual(self.refusal("Task", self.TYPES), "ABC has no issue type 'Task' for an issue under an epic; it has Feature and Bug: name one in `jira-finding-type`")
def test_a_sub_task_type_is_not_one_to_file_under_an_epic(self):
self.assertEqual(self.refusal("Subtask", self.TYPES), "ABC has no issue type 'Subtask' to file an issue under an epic as; its types are Feature and Bug")
def test_a_sub_task_type_and_the_epic_type_are_not_ones_for_an_issue_under_an_epic(self):
for kind in ("Subtask", "Epic"):
with self.subTest(kind=kind):
self.assertEqual(self.refusal(kind, self.TYPES), f"ABC has no issue type {kind!r} for an issue under an epic; it has Feature and Bug: name one in `jira-finding-type`")
def test_says_the_project_has_no_type_where_it_has_only_sub_task_types(self):
self.assertEqual(self.refusal("Bug", {"issueTypes": [{"name": "Subtask", "subtask": True}]}), "ABC has no issue type 'Bug' to file an issue under an epic as; its types are none")
def test_says_the_project_has_no_other_type_where_it_has_only_sub_task_types(self):
self.assertEqual(self.refusal("Bug", {"issueTypes": [{"name": "Subtask", "subtask": True}]}), "ABC has no issue type 'Bug' for an issue under an epic; it has no other type for one")
def test_says_why_where_jira_fails_or_answers_in_another_shape(self):
def test_says_why_where_jira_fails(self):
self.assertEqual(self.refusal("Bug", Failure("Jira answered 403")), "cannot read ABC's issue types: Jira answered 403")
def test_says_so_where_jira_answers_in_another_shape(self):
for wrong in ([], {}, {"issueTypes": "Bug"}, {"issueTypes": [{"subtask": False}]}):
with self.subTest(wrong=wrong):
self.assertEqual(self.refusal("Bug", wrong), "Jira answered ABC's issue types in a shape its REST API version 3 doesn't document")