def test_no_message(self): e = github.GithubException(422, { 'message': 'Validation Failed', 'documentation_url': 'https://developer.github.com/v3/pulls/#create-a-pull-request', 'errors': [{ 'resource': 'PullRequest', 'field': 'head', 'code': 'invalid'} ]} ) self.assertEqual( "Unable to create pull request: Validation Failed (422)\n\n" "Check " "https://developer.github.com/v3/pulls/#create-a-pull-request " "for more information.", gpr._format_github_exception("create pull request", e))
def test_no_message(self): e = github.GithubException( 422, { "message": "Validation Failed", "documentation_url": "https://developer.github.com/v3/pulls/#create-a-pull-request", "errors": [ {"resource": "PullRequest", "field": "head", "code": "invalid"} ], }, ) self.assertEqual( "Unable to create pull request: Validation Failed (422)\n\n" "Check " "https://developer.github.com/v3/pulls/#create-a-pull-request " "for more information.", gpr._format_github_exception("create pull request", e), )
def test_issue_12(self): e = github.GithubException(422, { u'documentation_url': u'https://developer.github.com/v3/pulls/#create-a-pull-request', u'message': u'Validation Failed', u'errors': [{ u'message': u'No commits between issues-221 and issues-221', u'code': u'custom', u'resource': u'PullRequest'} ]} ) self.assertEqual( "Unable to create pull request: Validation Failed (422)\n" "No commits between issues-221 and issues-221\n" "Check " "https://developer.github.com/v3/pulls/#create-a-pull-request " "for more information.", gpr._format_github_exception("create pull request", e))
def test_issue_12(self): e = github.GithubException( 422, { u"documentation_url": u"https://developer.github.com/v3/pulls/#create-a-pull-request", u"message": u"Validation Failed", u"errors": [ { u"message": u"No commits between issues-221 and issues-221", u"code": u"custom", u"resource": u"PullRequest", } ], }, ) self.assertEqual( "Unable to create pull request: Validation Failed (422)\n" "No commits between issues-221 and issues-221\n" "Check " "https://developer.github.com/v3/pulls/#create-a-pull-request " "for more information.", gpr._format_github_exception("create pull request", e), )