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

Method testCompare

tests/Repository.py:830–883  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

828 )
829
830 def testCompare(self):
831 with self.captureRequests() as requests:
832 comparison = self.repo.compare("v0.6", "v0.7")
833 self.assertEqual(comparison.status, "ahead")
834 self.assertEqual(comparison.ahead_by, 4)
835 self.assertEqual(comparison.behind_by, 0)
836 self.assertEqual(
837 comparison.diff_url,
838 "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7.diff",
839 )
840 self.assertEqual(
841 comparison.html_url,
842 "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7",
843 )
844 self.assertEqual(
845 comparison.url,
846 "https://api.github.com/repos/PyGithub/PyGithub/compare/v0.6...v0.7",
847 )
848 self.assertEqual(
849 comparison.patch_url,
850 "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7.patch",
851 )
852 self.assertEqual(
853 comparison.permalink_url,
854 "https://github.com/PyGithub/PyGithub/compare/PyGithub:4303c5b...PyGithub:ecda065",
855 )
856 self.assertEqual(comparison.total_commits, 4)
857 self.assertListKeyEqual(
858 comparison.files,
859 lambda f: f.filename,
860 [
861 "ReferenceOfClasses.md",
862 "github/Github.py",
863 "github/Requester.py",
864 "setup.py",
865 ],
866 )
867 self.assertEqual(comparison.base_commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495")
868 self.assertListKeyEqual(
869 comparison.commits,
870 lambda c: c.sha,
871 [
872 "5bb654d26dd014d36794acd1e6ecf3736f12aad7",
873 "cb0313157bf904f2d364377d35d9397b269547a5",
874 "0cec0d25e606c023a62a4fc7cdc815309ebf6d16",
875 "ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7",
876 ],
877 )
878
879 self.assertListKeyEqual(
880 requests,
881 lambda r: r.url,
882 ["/repos/PyGithub/PyGithub/compare/v0.6...v0.7?page=1"],
883 )
884
885 def testCompareCommitsPerPage(self):
886 with self.captureRequests() as requests:

Callers

nothing calls this directly

Calls 3

captureRequestsMethod · 0.80
compareMethod · 0.80
assertListKeyEqualMethod · 0.80

Tested by

no test coverage detected