Hold the Jira backend's fake to credentials, JQL, fields and issue types, and test its failures
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""What every backend of an epic's plan must hold, as tests. A backend's test case inherits EpicStoreContract and unittest.TestCase, builds an epic with no issues in new_store, and changes an issue as a person would in the tracker in assign and close."""
|
||||
import re
|
||||
import typing
|
||||
|
||||
from do_epic.backend.protocol import EpicIssue, EpicStore
|
||||
@@ -47,10 +48,13 @@ class EpicStoreContract:
|
||||
self.assertEqual([(issue.key, issue.parent) for issue in read], [(first, store.epic), (task, first), (second, store.epic)])
|
||||
self.assertEqual((read[1].summary, read[1].labels, read[1].detail), ("Count them in the api.", ("api",), ""))
|
||||
|
||||
def test_files_each_issue_under_its_own_key(self) -> None:
|
||||
def test_files_each_issue_under_its_own_key_in_the_epics_project(self) -> None:
|
||||
store = self.new_store()
|
||||
keys = {self.filed(store, store.epic, "Count the runs."), self.filed(store, store.epic, "Count the runs.")}
|
||||
self.assertEqual(len(keys), 2)
|
||||
child = self.filed(store, store.epic, "Count the runs.")
|
||||
keys = [child, self.filed(store, store.epic, "Count the runs."), self.filed(store, child, "Count them in the api.")]
|
||||
self.assertEqual(len(set(keys)), 3)
|
||||
project = store.epic.rpartition("-")[0]
|
||||
self.assertEqual([re.fullmatch(f"{project}-[1-9][0-9]*", key) is not None for key in keys], [True] * 3)
|
||||
|
||||
def test_reads_the_assignee_and_a_done_status(self) -> None:
|
||||
store = self.new_store()
|
||||
|
||||
Reference in New Issue
Block a user