Exceptions.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Repobot 作者: Desgard 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号