def test_from_json_missing_parts(self): json_issue_no_key = { 'fields': { 'status': { 'name': u'Closed' } } } json_issue_no_status = { 'key': u'CFY-3223', 'fields': {} } self.assertIsNone(Issue.from_json(json_issue_no_key)) self.assertIsNone(Issue.from_json(json_issue_no_status))
def test_from_json(self): json_issue = { 'key': u'CFY-3223', 'fields': { 'status': { 'name': u'Closed' } } } expected_issue = Issue(u'CFY-3223', u'Closed') self.assertEqual(Issue.from_json(json_issue), expected_issue)
def test_from_json_no_json(self): self.assertIsNone(Issue.from_json(None))
def test_get_json_issue(self): self.assertIsNone(Issue.get_json_issue(None, 'jira_team_name'))