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

Method assertException

tests/Requester.py:421–433  ·  view source on GitHub ↗
(self, exception, exception_type, message, status, data, headers, string)

Source from the content-addressed store, hash-verified

419 self.assertFalse(github.Requester.Requester.isSecondaryRateLimitError(message), message)
420
421 def assertException(self, exception, exception_type, message, status, data, headers, string):
422 self.assertIsInstance(exception, exception_type)
423 if message is None:
424 self.assertIsNone(exception.message)
425 else:
426 self.assertEqual(exception.message, message)
427 self.assertEqual(exception.status, status)
428 if data is None:
429 self.assertIsNone(exception.data)
430 else:
431 self.assertEqual(exception.data, data)
432 self.assertEqual(exception.headers, headers)
433 self.assertEqual(str(exception), string)
434
435 def testShouldCreateBadCredentialsException(self):
436 exc = self.g._Github__requester.createException(401, {"header": "value"}, {"message": "Bad credentials"})

Calls

no outgoing calls

Tested by

no test coverage detected