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

Method testRestoreBranch

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

Source from the content-addressed store, hash-verified

574 )
575
576 def testRestoreBranch(self):
577 with self.assertRaises(github.UnknownObjectException) as raisedexp:
578 self.delete_restore_repo.get_branch(self.delete_restore_pull.head.ref)
579 self.assertEqual(raisedexp.exception.message, "Branch not found")
580 self.assertEqual(raisedexp.exception.status, 404)
581 self.assertEqual(
582 raisedexp.exception.data,
583 {
584 "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-branch",
585 "message": "Branch not found",
586 },
587 )
588 self.assertTrue(self.delete_restore_pull.restore_branch())
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))

Callers

nothing calls this directly

Calls 2

get_branchMethod · 0.80
restore_branchMethod · 0.80

Tested by

no test coverage detected