Answer stability round 1: 0 🔴, 1 🟡 (0 misread); refuse a blocker loop and link a blocker named twice once
CI / tests (pull_request) Failing after 3m48s
CI / tests (pull_request) Failing after 3m48s
This commit is contained in:
@@ -614,6 +614,10 @@ class Editing(unittest.TestCase):
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35, 36"}), Written(34))
|
||||
self.assertEqual(self.writes(), [("POST", LINKS, {"type": {"name": "Blocks"}, "inwardIssue": {"key": f"ABC-{blocker}"}, "outwardIssue": {"key": "ABC-34"}}) for blocker in (35, 36)])
|
||||
|
||||
def test_links_a_blocker_named_twice_once(self):
|
||||
self.edit(34, {"Blocked by": "35, 35"})
|
||||
self.assertEqual([body["inwardIssue"]["key"] for _, _, body in self.writes()], ["ABC-35"]) # type: ignore[index]
|
||||
|
||||
def test_deletes_the_link_of_each_blocker_the_edit_drops_and_makes_none_for_one_it_keeps(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "ABC-36"))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Written(34))
|
||||
@@ -669,6 +673,18 @@ class Editing(unittest.TestCase):
|
||||
self.assertEqual(self.edit(34, {"L": "2", "Blocked by": "35, 40"}), Failure("jira:https://acme.atlassian.net/browse/ABC-12 holds no item 40 to be blocked by"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_a_blocker_that_makes_the_issue_wait_for_itself_fails_before_any_write(self):
|
||||
self.open[1] = issue("ABC-35", scores=PROPERTY, blocked_by=("ABC-34",))
|
||||
self.open[2] = issue("ABC-36", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.assertEqual(self.edit(34, {"L": "2", "Blocked by": "36"}), Failure("jira:https://acme.atlassian.net/browse/ABC-12: item 34 would be blocked by itself through 35, 36; drop one of the blockers"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_a_loop_the_plan_holds_without_the_issue_does_not_stop_its_edit(self):
|
||||
self.open[1] = issue("ABC-35", scores=PROPERTY, blocked_by=("ABC-36",))
|
||||
self.open[2] = issue("ABC-36", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Written(34))
|
||||
self.assertEqual([method for method, _, _ in self.writes()], ["POST"])
|
||||
|
||||
def test_a_blocked_by_out_of_format_or_naming_the_issue_itself_fails_before_any_write(self):
|
||||
for cell in ("ABC-35", "35,36", "34"):
|
||||
with self.subTest(cell=cell):
|
||||
@@ -677,7 +693,8 @@ class Editing(unittest.TestCase):
|
||||
|
||||
def test_the_links_of_an_issue_a_person_filed_are_never_changed(self):
|
||||
for id_ in (35, 36):
|
||||
self.assertEqual(self.edit(id_, {"Blocked by": "34"}, None, COMMENT), Failure(f"a person filed ABC-{id_}, so the loop sets only its scores: change its summary, description, links and Fix Version in Jira"))
|
||||
with self.subTest(id_=id_):
|
||||
self.assertEqual(self.edit(id_, {"Blocked by": "34"}, None, COMMENT), Failure(f"a person filed ABC-{id_}, so the loop sets only its scores: change its summary, description, links and Fix Version in Jira"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_an_issue_that_is_no_open_child_of_the_epic_is_not_edited(self):
|
||||
|
||||
Reference in New Issue
Block a user