MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testRemoveProtection

Method testRemoveProtection

tests/Branch.py:158–173  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 self.assertListKeyEqual(branch_protection.get_team_push_restrictions(), lambda u: u.slug, [])
157
158 def testRemoveProtection(self):
159 self.assertTrue(self.protected_branch.protected)
160 self.protected_branch.remove_protection()
161 protected_branch = self.repo.get_branch("integrations")
162 self.assertFalse(protected_branch.protected)
163 with self.assertRaises(github.GithubException) as raisedexp:
164 protected_branch.get_protection()
165 self.assertEqual(raisedexp.exception.message, "Branch not protected")
166 self.assertEqual(raisedexp.exception.status, 404)
167 self.assertEqual(
168 raisedexp.exception.data,
169 {
170 "documentation_url": "https://developer.github.com/v3/repos/branches/#get-branch-protection",
171 "message": "Branch not protected",
172 },
173 )
174
175 def testEditRequiredStatusChecks(self):
176 self.protected_branch.edit_required_status_checks(strict=True)

Callers

nothing calls this directly

Calls 3

remove_protectionMethod · 0.80
get_branchMethod · 0.80
get_protectionMethod · 0.80

Tested by

no test coverage detected