Pick each epic item's repo by repo-rule.md and record the pick as a label on the issue
CI / tests (pull_request) Failing after 4m10s
CI / tests (pull_request) Failing after 4m10s
This commit is contained in:
@@ -86,3 +86,24 @@ class EpicStoreContract:
|
||||
self.assertEqual(store.file(store.epic_key, "Count the runs.", "", ("two words",)), Failure("the label 'two words' is empty or holds white space"))
|
||||
self.assertEqual(store.file(store.epic_key, "Count\nthe runs.", "", ()), Failure("the summary must be one line of text"))
|
||||
self.assertEqual(self.issues(store), [])
|
||||
|
||||
def test_adds_a_label_to_a_child_issue_and_keeps_the_others(self) -> None:
|
||||
store = self.new_store()
|
||||
key = self.filed(store, store.epic_key, "Count the runs.", labels=("api",))
|
||||
other = self.filed(store, store.epic_key, "Ship the later thing.")
|
||||
self.assertEqual([store.add_label(key, "repo:log"), store.add_label(key, "repo:log")], [None, None])
|
||||
read = {issue.key: issue for issue in self.issues(store)}
|
||||
self.assertEqual((read[key].labels, read[other].labels), (("api", "repo:log"), ()))
|
||||
|
||||
def test_refuses_to_label_a_sub_task_an_issue_outside_the_epic_or_a_label_with_white_space(self) -> None:
|
||||
store = self.new_store()
|
||||
child = self.filed(store, store.epic_key, "Count the runs.")
|
||||
task = self.filed(store, child, "Count them in the api.")
|
||||
for key, label, reason in (
|
||||
(task, "repo:log", f"{task} is not one of the child issues of the epic {store.epic_key}, so it cannot be labelled"),
|
||||
(child, "two words", "the label 'two words' is empty or holds white space"),
|
||||
):
|
||||
with self.subTest(key=key, label=label):
|
||||
self.assertEqual(store.add_label(key, label), Failure(reason))
|
||||
self.assertIsInstance(store.add_label("ZZZ-1", "repo:log"), Failure)
|
||||
self.assertEqual([issue.labels for issue in self.issues(store)], [(), ()])
|
||||
|
||||
Reference in New Issue
Block a user