| 243 | ) |
| 244 | |
| 245 | def testBaseUrlPortRedirection(self): |
| 246 | # replay data forged |
| 247 | gh = github.Github(base_url="https://api.github.com") |
| 248 | with self.assertRaises(RuntimeError) as exc: |
| 249 | gh.get_repo("PyGithub/PyGithub") |
| 250 | self.assertEqual( |
| 251 | exc.exception.args, |
| 252 | ( |
| 253 | "Requested https://api.github.com/repos/PyGithub/PyGithub but server " |
| 254 | "redirected to https://api.github.com:443/repos/PyGithub/PyGithub, " |
| 255 | "you may need to correct your Github server URL " |
| 256 | "via base_url: Github(base_url=...)", |
| 257 | ), |
| 258 | ) |
| 259 | |
| 260 | def testBaseUrlPrefixRedirection(self): |
| 261 | # replay data forged |