Repository.py 文件源码

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

项目:Repobot 作者: Desgard 项目源码 文件源码
def testRaiseErrorWithBranchProtectionWithInvalidEnforcementLevel(self):
        raised = False
        try:
            self.repo.protect_branch("master", True, "", ["test"])
        except github.GithubException as exception:
            raised = True
            self.assertEqual(exception.status, 422)
            self.assertEqual(
                exception.data, {
                    'documentation_url':
                    'https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection',
                    'message': 'Validation Failed',
                    'errors': [
                        {
                            'field': 'required_status_checks_enforcement_level',
                            'message': "required_status_checks_enforcement_level enforcement level '%s' is not valid",
                            'code': 'custom',
                            'resource': 'ProtectedBranch'
                        }
                    ]
                }
            )
            self.assertTrue(raised)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号