(self)
| 445 | ) |
| 446 | |
| 447 | def testShouldCreateTwoFactorException(self): |
| 448 | exc = self.g._Github__requester.createException( |
| 449 | 401, |
| 450 | {"x-github-otp": "required; app"}, |
| 451 | { |
| 452 | "message": "Must specify two-factor authentication OTP code.", |
| 453 | "documentation_url": "https://developer.github.com/v3/auth#working-with-two-factor-authentication", |
| 454 | }, |
| 455 | ) |
| 456 | self.assertException( |
| 457 | exc, |
| 458 | github.TwoFactorException, |
| 459 | None, |
| 460 | 401, |
| 461 | { |
| 462 | "message": "Must specify two-factor authentication OTP code.", |
| 463 | "documentation_url": "https://developer.github.com/v3/auth#working-with-two-factor-authentication", |
| 464 | }, |
| 465 | {"x-github-otp": "required; app"}, |
| 466 | '401 {"message": "Must specify two-factor authentication OTP code.", "documentation_url": "https://developer.github.com/v3/auth#working-with-two-factor-authentication"}', |
| 467 | ) |
| 468 | |
| 469 | def testShouldCreateBadUserAgentException(self): |
| 470 | exc = self.g._Github__requester.createException( |
nothing calls this directly
no test coverage detected