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

Method testDeleteBranch

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

Source from the content-addressed store, hash-verified

589 self.assertTrue(self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref))
590
591 def testDeleteBranch(self):
592 self.assertTrue(self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref))
593 self.delete_restore_pull.delete_branch(force=False)
594 with self.assertRaises(github.UnknownObjectException) as raisedexp:
595 self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref)
596 self.assertEqual(raisedexp.exception.message, "Branch not found")
597 self.assertEqual(raisedexp.exception.status, 404)
598 self.assertEqual(
599 raisedexp.exception.data,
600 {
601 "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-branch",
602 "message": "Branch not found",
603 },
604 )
605
606 def testForceDeleteBranch(self):
607 self.assertTrue(self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref))

Callers

nothing calls this directly

Calls 2

get_branchMethod · 0.80
delete_branchMethod · 0.80

Tested by

no test coverage detected