def testUnknownObject(self):
raised = False
try:
self.g.get_user().get_repo("Xxx")
except github.GithubException as exception:
raised = True
self.assertEqual(exception.status, 404)
self.assertEqual(exception.data, {"message": "Not Found"})
if atLeastPython26 and atMostPython2:
self.assertEqual(str(exception), "404 {u'message': u'Not Found'}")
else:
self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover (Covered with Python 3)
self.assertTrue(raised)
评论列表
文章目录