def testRaiseErrorWithOutBranch(self):
raised = False
try:
self.repo.protect_branch("", True, "everyone", ["test"])
except github.GithubException, exception:
raised = True
self.assertEqual(exception.status, 404)
self.assertEqual(
exception.data, {
u'documentation_url': u'https://developer.github.com/v3/repos/#get-branch',
u'message': u'Branch not found'
}
)
self.assertTrue(raised)
评论列表
文章目录