Merge branch 'topic/SpecificExceptions' into develop

This commit is contained in:
Vincent Jacques
2013-04-22 22:23:04 +02:00
7 changed files with 86 additions and 5 deletions
+8
View File
@@ -88,3 +88,11 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we
else:
self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") # pragma no cover (Covered with Python 3)
self.assertTrue(raised)
class SpecificExceptions(Framework.TestCase):
def testBadCredentials(self):
self.assertRaises(github.BadCredentialsException, lambda: github.Github("BadUser", "BadPassword").get_user().login)
def testUnknownObject(self):
self.assertRaises(github.UnknownObjectException, lambda: self.g.get_user().get_repo("Xxx"))