(self)
| 219 | ) |
| 220 | |
| 221 | def testBaseUrlSchemeRedirection(self): |
| 222 | gh = github.Github(base_url="http://api.github.com") |
| 223 | with self.assertRaises(RuntimeError) as exc: |
| 224 | gh.get_repo("PyGithub/PyGithub") |
| 225 | self.assertEqual( |
| 226 | exc.exception.args, |
| 227 | ( |
| 228 | "Github server redirected from http protocol to https, please correct your " |
| 229 | "Github server URL via base_url: Github(base_url=...)", |
| 230 | ), |
| 231 | ) |
| 232 | |
| 233 | def testBaseUrlHostRedirection(self): |
| 234 | gh = github.Github(base_url="https://www.github.com") |