mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Fix tests for Python <= 2.6
This commit is contained in:
@@ -28,10 +28,13 @@ class Enterprise(Framework.BasicTestCase):
|
||||
g = github.Github(self.login, self.password, base_url="http://my.enterprise.com")
|
||||
self.assertListKeyEqual(g.get_user().get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"])
|
||||
|
||||
def testUnknownUrlScheme(self):
|
||||
with self.assertRaises(AssertionError) as cm:
|
||||
def testUnknownUrlScheme(self): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument
|
||||
try:
|
||||
github.Github(self.login, self.password, base_url="foobar://my.enterprise.com")
|
||||
self.assertEqual(cm.exception.args[0], "Unknown URL scheme")
|
||||
except AssertionError, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.args[0], "Unknown URL scheme")
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testLongUrl(self):
|
||||
g = github.Github(self.login, self.password, base_url="http://my.enterprise.com/path/to/github")
|
||||
|
||||
Reference in New Issue
Block a user