-
-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
from tests.conftest import JiraTestCase | ||
|
||
|
||
class ProjectStatusesTests(JiraTestCase): | ||
def test_project_statuses(self): | ||
project_statuses = self.jira.project_statuses(self.project_a) | ||
class ProjectStatusesByIssueTypeTests(JiraTestCase): | ||
def test_project_statuses_by_issue_type(self): | ||
issue_types = self.jira.project_statuses_by_issue(self.project_a) | ||
|
||
# project should have at least one status | ||
self.assertGreater(len(project_statuses), 0) | ||
# should have at least one issue type within the project | ||
self.assertGreater(len(issue_types), 0) | ||
|
||
# first project status | ||
project_status = project_statuses[0] | ||
# test statues id | ||
self_status_id = self.jira.status(project_status.id).id | ||
self.assertEqual(self_status_id, project_status.id) | ||
# test statues name | ||
self_status_name = self.jira.status(project_status.name).name | ||
self.assertEqual(self_status_name, project_status.name) | ||
# get unique statuses across all issue types | ||
statuses = [] | ||
for issue_type in issue_types: | ||
# should have at least one valid status within an issue type by endpoint documentation | ||
self.assertGreater(len(issue_type.statuses), 0) | ||
statuses.extend(issue_type.statuses) | ||
unique_statuses = list(set(statuses)) | ||
|
||
# test status id and name for each status within the project | ||
for status in unique_statuses: | ||
self_status_id = self.jira.status(status.id).id | ||
self.assertEqual(self_status_id, status.id) | ||
self_status_name = self.jira.status(status.name).name | ||
self.assertEqual(self_status_name, status.name) |