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

Method testEditProtection

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

Source from the content-addressed store, hash-verified

78 self.assertIsNone(self.branch.required_approving_review_count)
79
80 def testEditProtection(self):
81 self.protected_branch.edit_protection(
82 strict=True,
83 require_code_owner_reviews=True,
84 required_approving_review_count=2,
85 require_last_push_approval=True,
86 )
87 branch_protection = self.protected_branch.get_protection()
88 self.assertTrue(branch_protection.required_status_checks.strict)
89 self.assertEqual(branch_protection.required_status_checks.checks, [])
90 self.assertEqual(branch_protection.required_status_checks.contexts, [])
91 self.assertEqual(
92 branch_protection.required_status_checks.contexts_url,
93 "https://api.github.com/repos/jacquev6/PyGithub/branches/integrations/protection/required_status_checks/contexts",
94 )
95 self.assertTrue(branch_protection.enforce_admins)
96 self.assertFalse(branch_protection.required_linear_history)
97 self.assertFalse(branch_protection.allow_deletions)
98 self.assertFalse(branch_protection.required_pull_request_reviews.dismiss_stale_reviews)
99 self.assertTrue(branch_protection.required_pull_request_reviews.require_code_owner_reviews)
100 self.assertEqual(
101 branch_protection.required_pull_request_reviews.required_approving_review_count,
102 2,
103 )
104 self.assertTrue(branch_protection.required_pull_request_reviews.require_last_push_approval)
105 self.assertEqual(
106 branch_protection.required_pull_request_reviews.url,
107 "https://api.github.com/repos/jacquev6/PyGithub/branches/integrations/protection/required_pull_request_reviews",
108 )
109
110 def testEditProtectionDismissalUsersWithUserOwnedBranch(self):
111 with self.assertRaises(github.GithubException) as raisedexp:

Callers

nothing calls this directly

Calls 2

edit_protectionMethod · 0.80
get_protectionMethod · 0.80

Tested by

no test coverage detected