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

Method testForceDeleteBranch

tests/PullRequest.py:606–619  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

604 )
605
606 def testForceDeleteBranch(self):
607 self.assertTrue(self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref))
608 self.assertEqual(self.delete_restore_pull.delete_branch(force=True), None)
609 with self.assertRaises(github.UnknownObjectException) as raisedexp:
610 self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref)
611 self.assertEqual(raisedexp.exception.message, "Branch not found")
612 self.assertEqual(raisedexp.exception.status, 404)
613 self.assertEqual(
614 raisedexp.exception.data,
615 {
616 "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-branch",
617 "message": "Branch not found",
618 },
619 )
620
621 def testEnableAutomerge(self):
622 # To reproduce this, the PR repository need to have the "Allow auto-merge" option enabled

Callers

nothing calls this directly

Calls 2

get_branchMethod · 0.80
delete_branchMethod · 0.80

Tested by

no test coverage detected