(self)
| 883 | ) |
| 884 | |
| 885 | def testCompareCommitsPerPage(self): |
| 886 | with self.captureRequests() as requests: |
| 887 | comparison = self.repo.compare("v0.6", "v0.7", comparison_commits_per_page=3) |
| 888 | |
| 889 | self.assertEqual( |
| 890 | comparison.diff_url, |
| 891 | "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7.diff", |
| 892 | ) |
| 893 | self.assertEqual( |
| 894 | comparison.html_url, |
| 895 | "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7", |
| 896 | ) |
| 897 | self.assertEqual( |
| 898 | comparison.url, |
| 899 | "https://api.github.com/repos/PyGithub/PyGithub/compare/v0.6...v0.7", |
| 900 | ) |
| 901 | self.assertEqual( |
| 902 | comparison.patch_url, |
| 903 | "https://github.com/PyGithub/PyGithub/compare/v0.6...v0.7.patch", |
| 904 | ) |
| 905 | self.assertEqual( |
| 906 | comparison.permalink_url, |
| 907 | "https://github.com/PyGithub/PyGithub/compare/PyGithub:4303c5b...PyGithub:ecda065", |
| 908 | ) |
| 909 | self.assertEqual(comparison.total_commits, 4) |
| 910 | self.assertListKeyEqual( |
| 911 | comparison.commits, |
| 912 | lambda c: c.sha, |
| 913 | [ |
| 914 | "5bb654d26dd014d36794acd1e6ecf3736f12aad7", |
| 915 | "cb0313157bf904f2d364377d35d9397b269547a5", |
| 916 | "0cec0d25e606c023a62a4fc7cdc815309ebf6d16", |
| 917 | "ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7", |
| 918 | ], |
| 919 | ) |
| 920 | |
| 921 | self.assertListKeyEqual( |
| 922 | requests, |
| 923 | lambda r: r.url, |
| 924 | [ |
| 925 | "/repos/PyGithub/PyGithub/compare/v0.6...v0.7?page=1&per_page=3", |
| 926 | "/repositories/3544490/compare/v0.6...v0.7?page=2&per_page=3", |
| 927 | ], |
| 928 | ) |
| 929 | |
| 930 | def testCompareCommitPagination(self): |
| 931 | gh = github.Github( |
nothing calls this directly
no test coverage detected