On the way to publish tests (issue #86)

This commit only moves stuff around.
Modifications will be done in next commit.
This commit is contained in:
Vincent Jacques
2012-09-16 20:07:33 +02:00
parent 442b66c81c
commit aadb06753c
327 changed files with 0 additions and 0 deletions
+175
View File
@@ -0,0 +1,175 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import github
import datetime
class AuthenticatedUser( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.user = self.g.get_user()
def testAttributes( self ):
self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" )
self.assertEqual( self.user.bio, "" )
self.assertEqual( self.user.blog, "http://vincent-jacques.net" )
self.assertEqual( self.user.collaborators, 0 )
self.assertEqual( self.user.company, "Criteo" )
self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) )
self.assertEqual( self.user.disk_usage, 16692 )
self.assertEqual( self.user.email, "vincent@vincent-jacques.net" )
self.assertEqual( self.user.followers, 13 )
self.assertEqual( self.user.following, 24 )
self.assertEqual( self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225" )
self.assertEqual( self.user.hireable, False )
self.assertEqual( self.user.html_url, "https://github.com/jacquev6" )
self.assertEqual( self.user.id, 327146 )
self.assertEqual( self.user.location, "Paris, France" )
self.assertEqual( self.user.login, "jacquev6" )
self.assertEqual( self.user.name, "Vincent Jacques" )
self.assertEqual( self.user.owned_private_repos, 5 )
self.assertEqual( self.user.plan.name, "micro" )
self.assertEqual( self.user.plan.collaborators, 1 )
self.assertEqual( self.user.plan.space, 614400 )
self.assertEqual( self.user.plan.private_repos, 5 )
self.assertEqual( self.user.private_gists, 5 )
self.assertEqual( self.user.public_gists, 1 )
self.assertEqual( self.user.public_repos, 10 )
self.assertEqual( self.user.total_private_repos, 5 )
self.assertEqual( self.user.type, "User" )
self.assertEqual( self.user.url, "https://api.github.com/users/jacquev6" )
def testEditWithoutArguments( self ):
self.user.edit()
def testEditWithAllArguments( self ):
self.user.edit( "Name edited by PyGithub", "Email edited by PyGithub", "Blog edited by PyGithub", "Company edited by PyGithub", "Location edited by PyGithub", True, "Bio edited by PyGithub" )
self.assertEqual( self.user.name, "Name edited by PyGithub" )
self.assertEqual( self.user.email, "Email edited by PyGithub" )
self.assertEqual( self.user.blog, "Blog edited by PyGithub" )
self.assertEqual( self.user.company, "Company edited by PyGithub" )
self.assertEqual( self.user.location, "Location edited by PyGithub" )
self.assertEqual( self.user.hireable, True )
self.assertEqual( self.user.bio, "Bio edited by PyGithub" )
def testEmails( self ):
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] )
self.user.add_to_emails( "1@foobar.com", "2@foobar.com" )
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "1@foobar.com", "2@foobar.com", "github.com@vincent-jacques.net" ] )
self.user.remove_from_emails( "1@foobar.com", "2@foobar.com" )
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] )
def testFollowing( self ):
nvie = self.g.get_user( "nvie" )
self.assertListKeyEqual( self.user.get_following(), lambda u: u.login, [ "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa", "nvie" ] )
self.assertEqual( self.user.has_in_following( nvie ), True )
self.user.remove_from_following( nvie )
self.assertEqual( self.user.has_in_following( nvie ), False )
self.user.add_to_following( nvie )
self.assertEqual( self.user.has_in_following( nvie ), True )
self.assertListKeyEqual( self.user.get_followers(), lambda u: u.login, [ "jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y" ] )
def testWatching( self ):
gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" )
self.assertListKeyEqual( self.user.get_watched(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub" ] )
self.assertEqual( self.user.has_in_watched( gitflow ), True )
self.user.remove_from_watched( gitflow )
self.assertEqual( self.user.has_in_watched( gitflow ), False )
self.user.add_to_watched( gitflow )
self.assertEqual( self.user.has_in_watched( gitflow ), True )
def testStarring( self ):
gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" )
self.assertListKeyEqual( self.user.get_starred(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly" ] )
self.assertEqual( self.user.has_in_starred( gitflow ), True )
self.user.remove_from_starred( gitflow )
self.assertEqual( self.user.has_in_starred( gitflow ), False )
self.user.add_to_starred( gitflow )
self.assertEqual( self.user.has_in_starred( gitflow ), True )
def testSubscriptions( self ):
gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" )
self.assertListKeyEqual( self.user.get_subscriptions(), lambda r: r.name, [ "gitflow", "ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub" ] )
self.assertEqual( self.user.has_in_subscriptions( gitflow ), True )
self.user.remove_from_subscriptions( gitflow )
self.assertEqual( self.user.has_in_subscriptions( gitflow ), False )
self.user.add_to_subscriptions( gitflow )
self.assertEqual( self.user.has_in_subscriptions( gitflow ), True )
def testGetAuthorizations( self ):
self.assertListKeyEqual( self.user.get_authorizations(), lambda a: a.id, [ 372294 ] )
def testCreateRepository( self ):
repo = self.user.create_repo( "TestPyGithub" )
self.assertEqual( repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub" )
def testCreateRepositoryWithAllArguments( self ):
repo = self.user.create_repo( "TestPyGithub", "Repo created by PyGithub", "http://foobar.com", private = False, has_issues = False, has_wiki = False, has_downloads = False )
self.assertEqual( repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub" )
def testCreateAuthorizationWithoutArguments( self ):
authorization = self.user.create_authorization()
self.assertEqual( authorization.id, 372259 )
def testCreateAuthorizationWithAllArguments( self ):
authorization = self.user.create_authorization( [ "repo" ], "Note created by PyGithub", "http://vincent-jacques.net/PyGithub" )
self.assertEqual( authorization.id, 372294 )
def testCreateGist( self ):
gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) }, "Gist created by PyGithub" )
self.assertEqual( gist.description, "Gist created by PyGithub" )
self.assertEqual( gist.files.keys(), [ "foobar.txt" ] )
self.assertEqual( gist.files[ "foobar.txt" ].content, "File created by PyGithub" )
def testCreateGistWithoutDescription( self ):
gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) } )
self.assertEqual( gist.description, None )
self.assertEqual( gist.files.keys(), [ "foobar.txt" ] )
self.assertEqual( gist.files[ "foobar.txt" ].content, "File created by PyGithub" )
def testCreateKey( self ):
key = self.user.create_key( "Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE" )
self.assertEqual( key.id, 2626650 )
def testGetEvents( self ):
self.assertListKeyBegin( self.user.get_events(), lambda e: e.type, [ "PushEvent", "IssuesEvent", "IssueCommentEvent", "PushEvent" ] )
def testGetOrganizationEvents( self ):
self.assertListKeyBegin( self.user.get_organization_events( self.g.get_organization( "BeaverSoftware" ) ), lambda e: e.type, [ "CreateEvent", "CreateEvent", "PushEvent", "PushEvent" ] )
def testGetGists( self ):
self.assertListKeyEqual( self.user.get_gists(), lambda g: g.id, [ "2793505", "2793179", "11cb445f8197e17d303d", "1942384", "dcb7de17e8a52b74541d" ] )
def testGetStarredGists( self ):
self.assertListKeyEqual( self.user.get_starred_gists(), lambda g: g.id, [ "1942384", "dcb7de17e8a52b74541d" ] )
def testGetIssues( self ):
self.assertListKeyEqual( self.user.get_issues(), lambda i: ( i.id, i.repository.name ), [ ( 4639931, "PyGithub" ), ( 4452000, "PyGithub" ), ( 4356743, "PyGithub" ), ( 3716033, "PyGithub" ), ( 3715946, "PyGithub" ), ( 3643837, "PyGithub" ), ( 3628022, "PyGithub" ), ( 3624595, "PyGithub" ), ( 3624570, "PyGithub" ), ( 3624561, "PyGithub" ), ( 3624556, "PyGithub" ), ( 3619973, "PyGithub" ), ( 3527266, "PyGithub" ), ( 3527245, "PyGithub" ), ( 3527231, "PyGithub" ) ] )
def testGetKeys( self ):
self.assertListKeyEqual( self.user.get_keys(), lambda k: k.title, [ "vincent@home", "vincent@gandi", "vincent@aws", "vincent@macbook" ] )
def testGetOrgs( self ):
self.assertListKeyEqual( self.user.get_orgs(), lambda o: o.login, [ "BeaverSoftware" ] )
def testGetRepos( self ):
self.assertListKeyEqual( self.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 testGetReposWithArguments( self ):
self.assertListKeyEqual( self.user.get_repos( "public", "full_name", "desc" ), lambda r: r.name, [ "ViDE", "QuadProgMm", "PyGithub", "DrawTurksHead", "DrawSyntax", "django", "developer.github.com", "C4Planner", "Boost.HierarchicalEnum", "acme-public-website" ] )
def testCreateFork( self ):
repo = self.user.create_fork( self.g.get_user( "nvie" ).get_repo( "gitflow" ) )
self.assertEqual( repo.source.full_name, "nvie/gitflow" )
+28
View File
@@ -0,0 +1,28 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import github
class Authentication( Framework.BasicTestCase ):
def testNoAuthentication( self ):
g = github.Github()
self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" )
def testBasicAuthentication( self ):
g = github.Github( self.login, self.password )
self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" )
def testOAuthAuthentication( self ):
g = github.Github( self.oauth_token )
self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" )
+51
View File
@@ -0,0 +1,51 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Authorization( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.authorization = self.g.get_user().get_authorization( 372259 )
def testAttributes( self ):
self.assertEqual( self.authorization.app.url, "http://developer.github.com/v3/oauth/#oauth-authorizations-api" )
self.assertEqual( self.authorization.app.name, "GitHub API" )
self.assertEqual( self.authorization.created_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) )
self.assertEqual( self.authorization.id, 372259 )
self.assertEqual( self.authorization.note, None )
self.assertEqual( self.authorization.note_url, None )
self.assertEqual( self.authorization.scopes, [] )
self.assertEqual( self.authorization.token, "82459c4500086f8f0cc67d2936c17d1e27ad1c33" )
self.assertEqual( self.authorization.updated_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) )
self.assertEqual( self.authorization.url, "https://api.github.com/authorizations/372259" )
def testEdit( self ):
self.authorization.edit()
self.assertEqual( self.authorization.scopes, [] )
self.authorization.edit( scopes = [ "user" ] )
self.assertEqual( self.authorization.scopes, [ "user" ] )
self.authorization.edit( add_scopes = [ "repo" ] )
self.assertEqual( self.authorization.scopes, [ "user", "repo" ] )
self.authorization.edit( remove_scopes = [ "repo" ] )
self.assertEqual( self.authorization.scopes, [ "user" ] )
self.assertEqual( self.authorization.note, None )
self.assertEqual( self.authorization.note_url, None )
self.authorization.edit( note = "Note created by PyGithub", note_url = "http://vincent-jacques.net/PyGithub" )
self.assertEqual( self.authorization.note, "Note created by PyGithub" )
self.assertEqual( self.authorization.note_url, "http://vincent-jacques.net/PyGithub" )
def testDelete( self ):
self.authorization.delete()
+23
View File
@@ -0,0 +1,23 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class Branch( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.branch = self.g.get_user().get_repo( "PyGithub" ).get_branches()[ 0 ]
def testAttributes( self ):
self.assertEqual( self.branch.name, "topic/RewriteWithGeneratedCode" )
self.assertEqual( self.branch.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
+80
View File
@@ -0,0 +1,80 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class Commit( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.commit = self.g.get_user().get_repo( "PyGithub" ).get_commit( "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.commit.author.login # to force lazy completion
def testAttributes( self ):
self.assertEqual( self.commit.author.login, "jacquev6" )
self.assertEqual( self.commit.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.assertEqual( self.commit.committer.login, "jacquev6" )
self.assertEqual( len( self.commit.files ), 1 )
self.assertEqual( self.commit.files[ 0 ].additions, 0 )
self.assertEqual( self.commit.files[ 0 ].blob_url, "https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py" )
self.assertEqual( self.commit.files[ 0 ].changes, 20 )
self.assertEqual( self.commit.files[ 0 ].deletions, 20 )
self.assertEqual( self.commit.files[ 0 ].filename, "github/GithubObjects/GitAuthor.py" )
self.assertTrue( isinstance( self.commit.files[ 0 ].patch, ( str, unicode ) ) )
self.assertEqual( self.commit.files[ 0 ].raw_url, "https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py" )
self.assertEqual( self.commit.files[ 0 ].sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.assertEqual( self.commit.files[ 0 ].status, "modified" )
self.assertEqual( len( self.commit.parents ), 1 )
self.assertEqual( self.commit.parents[ 0 ].sha, "b46ed0dfde5ad02d3b91eb54a41c5ed960710eae" )
self.assertEqual( self.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.assertEqual( self.commit.stats.deletions, 20 )
self.assertEqual( self.commit.stats.additions, 0 )
self.assertEqual( self.commit.stats.total, 20 )
self.assertEqual( self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
def testGetComments( self ):
self.assertListKeyEqual( self.commit.get_comments(), lambda c: c.id, [ 1347033, 1347083, 1347397, 1349654 ] )
def testCreateComment( self ):
comment = self.commit.create_comment( "Comment created by PyGithub" )
self.assertEqual( comment.id, 1361949 )
self.assertEqual( comment.line, None )
self.assertEqual( comment.path, None )
self.assertEqual( comment.position, None )
def testCreateCommentOnFileLine( self ):
comment = self.commit.create_comment( "Comment created by PyGithub", path = "codegen/templates/GithubObject.MethodBody.UseResult.py", line = 26 )
self.assertEqual( comment.id, 1362000 )
self.assertEqual( comment.line, 26 )
self.assertEqual( comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py" )
self.assertEqual( comment.position, None )
def testCreateCommentOnFilePosition( self ):
comment = self.commit.create_comment( "Comment also created by PyGithub", path = "codegen/templates/GithubObject.MethodBody.UseResult.py", position = 3 )
self.assertEqual( comment.id, 1362001 )
self.assertEqual( comment.line, None )
self.assertEqual( comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py" )
self.assertEqual( comment.position, 3 )
def testCreateStatusWithoutOptionalParameters( self ):
status = self.commit.create_status( "pending" )
self.assertEqual( status.id, 277031 )
self.assertEqual( status.state, "pending" )
self.assertEqual( status.target_url, None )
self.assertEqual( status.description, None )
def testCreateStatusWithAllParameters( self ):
status = self.commit.create_status( "success", "https://github.com/jacquev6/PyGithub/issues/67", "Status successfuly created by PyGithub" )
self.assertEqual( status.id, 277040 )
self.assertEqual( status.state, "success" )
self.assertEqual( status.target_url, "https://github.com/jacquev6/PyGithub/issues/67" )
self.assertEqual( status.description, "Status successfuly created by PyGithub" )
+40
View File
@@ -0,0 +1,40 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class CommitComment( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.comment = self.g.get_user().get_repo( "PyGithub" ).get_comment( 1361949 )
def testAttributes( self ):
self.assertEqual( self.comment.body, "Comment created by PyGithub" )
self.assertEqual( self.comment.commit_id, "6945921c529be14c3a8f566dd1e483674516d46d" )
self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) )
self.assertEqual( self.comment.html_url, "https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949" )
self.assertEqual( self.comment.id, 1361949 )
self.assertEqual( self.comment.line, None )
self.assertEqual( self.comment.path, None )
self.assertEqual( self.comment.position, None )
self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) )
self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/comments/1361949" )
self.assertEqual( self.comment.user.login, "jacquev6" )
def testEdit( self ):
self.comment.edit( "Comment edited by PyGithub" )
def testDelete( self ):
self.comment.delete()
+34
View File
@@ -0,0 +1,34 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import github
import datetime
class CommitStatus( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.statuses = list( self.g.get_user().get_repo( "PyGithub" ).get_commit( "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ).get_statuses() )
def testAttributes( self ):
self.assertEqual( self.statuses[ 0 ].created_at, datetime.datetime( 2012, 9, 8, 11, 30, 56 ) )
self.assertEqual( self.statuses[ 0 ].updated_at, datetime.datetime( 2012, 9, 8, 11, 30, 56 ) )
self.assertEqual( self.statuses[ 0 ].creator.login, "jacquev6" )
self.assertEqual( self.statuses[ 0 ].description, "Status successfuly created by PyGithub" )
self.assertEqual( self.statuses[ 1 ].description, None )
self.assertEqual( self.statuses[ 0 ].id, 277040 )
self.assertEqual( self.statuses[ 0 ].state, "success" )
self.assertEqual( self.statuses[ 1 ].state, "pending" )
self.assertEqual( self.statuses[ 0 ].target_url, "https://github.com/jacquev6/PyGithub/issues/67" )
self.assertEqual( self.statuses[ 1 ].target_url, None )
+33
View File
@@ -0,0 +1,33 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import base64
import Framework
import github
import datetime
class ContentFile( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.file = self.g.get_user().get_repo( "PyGithub" ).get_readme()
def testAttributes( self ):
self.assertEqual( self.file.type, "file" )
self.assertEqual( self.file.encoding, "base64" )
self.assertEqual( self.file.size, 7531 )
self.assertEqual( self.file.name, "ReadMe.md" )
self.assertEqual( self.file.path, "ReadMe.md" )
self.assertEqual( len( base64.b64decode( self.file.content ) ), 7531 )
self.assertEqual( self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0" )
+46
View File
@@ -0,0 +1,46 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Download( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.download = self.g.get_user().get_repo( "PyGithub" ).get_download( 242550 )
def testAttributes( self ):
self.assertEqual( self.download.accesskeyid, None )
self.assertEqual( self.download.acl, None )
self.assertEqual( self.download.bucket, None )
self.assertEqual( self.download.content_type, "text/plain" )
self.assertEqual( self.download.created_at, datetime.datetime( 2012, 5, 22, 18, 58, 32 ) )
self.assertEqual( self.download.description, None )
self.assertEqual( self.download.download_count, 0 )
self.assertEqual( self.download.expirationdate, None )
self.assertEqual( self.download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt" )
self.assertEqual( self.download.id, 242550 )
self.assertEqual( self.download.mime_type, None )
self.assertEqual( self.download.name, "Foobar.txt" )
self.assertEqual( self.download.path, None )
self.assertEqual( self.download.policy, None )
self.assertEqual( self.download.prefix, None )
self.assertEqual( self.download.redirect, None )
self.assertEqual( self.download.s3_url, None )
self.assertEqual( self.download.signature, None )
self.assertEqual( self.download.size, 1024 )
self.assertEqual( self.download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242550" )
def testDelete( self ):
self.download.delete()
+36
View File
@@ -0,0 +1,36 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import github
import Framework
# Replay data for this test case is forged, because I don't have access to a real Github Enterprise install
class Enterprise( Framework.BasicTestCase ):
def testHttps( self ):
g = github.Github( self.login, self.password, base_url = "https://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 testHttp( self ):
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 testLongUrl( self ):
g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com/path/to/github" )
repos = g.get_user().get_repos()
self.assertListKeyEqual( 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" ] )
self.assertEqual( repos[ 0 ].owner.name, "Vincent Jacques" )
def testSpecificPort( self ):
g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com:8080" )
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" ] )
+31
View File
@@ -0,0 +1,31 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Event( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.event = self.g.get_user( "jacquev6" ).get_events()[ 0 ]
def testAttributes( self ):
self.assertEqual( self.event.actor.login, "jacquev6" )
self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 26, 10, 1, 39 ) )
self.assertEqual( self.event.id, "1556114751" )
self.assertEqual( self.event.org, None )
self.assertEqual( self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11} )
self.assertEqual( self.event.public, True )
self.assertEqual( self.event.repo.name, "jacquev6/PyGithub" )
self.assertEqual( self.event.type, "PushEvent" )
+82
View File
@@ -0,0 +1,82 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import github
import sys
import Framework
atLeastPython26 = sys.hexversion >= 0x02060000
# To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument
class Exceptions( Framework.TestCase ):
def testInvalidInput( self ):
try:
self.g.get_user().create_key( "Bad key", "xxx" )
self.fail( "Should have raised" )
except github.GithubException, exception:
self.assertEqual( exception.status, 422 )
self.assertEqual(
exception.data,
{
"errors": [
{
"code": "custom",
"field": "key",
"message": "key is invalid. It must begin with 'ssh-rsa' or 'ssh-dss'. Check that you're copying the public half of the key",
"resource": "PublicKey"
}
],
"message": "Validation Failed"
}
)
if atLeastPython26:
self.assertEqual( str( exception ), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}" )
else:
self.assertEqual( str( exception ), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}" )
def testUnknownObject( self ):
try:
self.g.get_user().get_repo( "Xxx" )
self.fail( "Should have raised" )
except github.GithubException, exception:
self.assertEqual( exception.status, 404 )
self.assertEqual( exception.data, { "message": "Not Found" } )
if atLeastPython26:
self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" )
else:
self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" )
def testUnknownUser( self ):
try:
self.g.get_user( "ThisUserShouldReallyNotExist" )
self.fail( "Should have raised" )
except github.GithubException, exception:
self.assertEqual( exception.status, 404 )
self.assertEqual( exception.data, { "message": "Not Found" } )
if atLeastPython26:
self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" )
else:
self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" )
def testBadAuthentication( self ):
try:
github.Github( "BadUser", "BadPassword" ).get_user().login
self.fail( "Should have raised" )
except github.GithubException, exception:
self.assertEqual( exception.status, 401 )
self.assertEqual( exception.data, { "message": "Bad credentials" } )
if atLeastPython26:
self.assertEqual( str( exception ), "401 {u'message': u'Bad credentials'}" )
else:
self.assertEqual( str( exception ), "401 {'message': 'Bad credentials'}" )
+182
View File
@@ -0,0 +1,182 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import unittest
import httplib
import traceback
import itertools
sys.path = [ os.path.join( os.path.dirname( __file__ ), ".." ) ] + sys.path
import github
class FakeHttpResponse:
def __init__( self, status, headers, output ):
self.status = status
self.__headers = headers
self.__output = output
def getheaders( self ):
return self.__headers
def read( self ):
return self.__output
def fixAuthorizationHeader( headers ):
if "Authorization" in headers:
if headers[ "Authorization" ].startswith( "token " ):
headers[ "Authorization" ] = "token private_token_removed"
elif headers[ "Authorization" ].startswith( "Basic " ):
headers[ "Authorization" ] = "Basic login_and_password_removed"
else:
assert False
class RecordingConnection:
def __init__( self, file, protocol, host, port, *args, **kwds ):
self.__file = file
self.__protocol = protocol
self.__host = host
self.__port = str( port )
self.__cnx = self._realConnection( host, port, *args, **kwds )
def request( self, verb, url, input, headers ):
print verb, url, input, headers,
self.__cnx.request( verb, url, input, headers )
fixAuthorizationHeader( headers )
self.__file.write( self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str( headers ) + " " + input + "\n" )
def getresponse( self ):
res = self.__cnx.getresponse()
status = res.status
print "=>", status
headers = res.getheaders()
output = res.read()
self.__file.write( str( status ) + "\n" )
self.__file.write( str( headers ) + "\n" )
self.__file.write( str( output ) + "\n" )
return FakeHttpResponse( status, headers, output )
def close( self ):
self.__file.write( "\n" )
return self.__cnx.close()
class RecordingHttpConnection( RecordingConnection ):
_realConnection = httplib.HTTPConnection
def __init__( self, file, *args, **kwds ):
RecordingConnection.__init__( self, file, "http", *args, **kwds )
class RecordingHttpsConnection( RecordingConnection ):
_realConnection = httplib.HTTPSConnection
def __init__( self, file, *args, **kwds ):
print args, kwds
RecordingConnection.__init__( self, file, "https", *args, **kwds )
class ReplayingConnection:
def __init__( self, testCase, file, protocol, host, port, *args, **kwds ):
self.__testCase = testCase
self.__file = file
self.__protocol = protocol
self.__host = host
self.__port = str( port )
def request( self, verb, url, input, headers ):
fixAuthorizationHeader( headers )
expectation = self.__file.readline().strip()
self.__testCase.assertEqual( self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str( headers ) + " " + input, expectation )
def getresponse( self ):
status = int( self.__file.readline().strip() )
headers = eval( self.__file.readline().strip() )
output = self.__file.readline().strip()
return FakeHttpResponse( status, headers, output )
def close( self ):
self.__file.readline()
def ReplayingHttpConnection( testCase, file, *args, **kwds ):
return ReplayingConnection( testCase, file, "http", *args, **kwds )
def ReplayingHttpsConnection( testCase, file, *args, **kwds ):
return ReplayingConnection( testCase, file, "https", *args, **kwds )
class BasicTestCase( unittest.TestCase ):
recordMode = False
def setUp( self ):
unittest.TestCase.setUp( self )
self.__fileName = ""
self.__file = None
if self.recordMode:
github.Requester.Requester.injectConnectionClasses(
lambda ignored, *args, **kwds: RecordingHttpConnection( self.__openFile( "wb" ), *args, **kwds ),
lambda ignored, *args, **kwds: RecordingHttpsConnection( self.__openFile( "wb" ), *args, **kwds )
)
import GithubCredentials
self.login = GithubCredentials.login
self.password = GithubCredentials.password
self.oauth_token = GithubCredentials.oauth_token
else:
github.Requester.Requester.injectConnectionClasses(
lambda ignored, *args, **kwds: ReplayingHttpConnection( self, self.__openFile( "r" ), *args, **kwds ),
lambda ignored, *args, **kwds: ReplayingHttpsConnection( self, self.__openFile( "r" ), *args, **kwds )
)
self.login = "login"
self.password = "password"
self.oauth_token = "oauth_token"
def tearDown( self ):
unittest.TestCase.tearDown( self )
self.__closeReplayFileIfNeeded()
def __openFile( self, mode ):
for ( _, _, functionName, _ ) in traceback.extract_stack():
if functionName.startswith( "test" ) or functionName == "setUp" or functionName == "tearDown":
if functionName != "test": # because in class Hook( Framework.TestCase ), method testTest calls Hook.test
fileName = os.path.join( os.path.dirname( __file__ ), "ReplayData", self.__class__.__name__ + "." + functionName + ".txt" )
if fileName != self.__fileName:
self.__closeReplayFileIfNeeded()
self.__fileName = fileName
self.__file = open( self.__fileName, mode )
return self.__file
def __closeReplayFileIfNeeded( self ):
if self.__file is not None:
if not self.recordMode:
self.assertEqual( self.__file.readline(), "" )
self.__file.close()
def assertListKeyEqual( self, elements, key, expectedKeys ):
realKeys = [ key( element ) for element in elements ]
self.assertEqual( realKeys, expectedKeys )
def assertListKeyBegin( self, elements, key, expectedKeys ):
realKeys = [ key( element ) for element in elements[ : len( expectedKeys ) ] ]
self.assertEqual( realKeys, expectedKeys )
class TestCase( BasicTestCase ):
def setUp( self ):
BasicTestCase.setUp( self )
self.g = github.Github( self.login, self.password )
def main():
if "--record" in sys.argv:
BasicTestCase.recordMode = True
unittest.main( argv = [ arg for arg in sys.argv if arg != "--record" ] )
+86
View File
@@ -0,0 +1,86 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import github
import datetime
class Gist( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.gist = self.g.get_gist( "2729810" )
def testAttributes( self ):
self.assertEquals( self.gist.comments, 0 )
self.assertEquals( self.gist.created_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) )
self.assertEquals( self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)" )
self.assertEquals( self.gist.files.keys(), [ "fail_github.py" ] )
self.assertEquals( self.gist.files[ "fail_github.py" ].size, 1636 )
self.assertEquals( self.gist.files[ "fail_github.py" ].filename, "fail_github.py" )
self.assertEquals( self.gist.files[ "fail_github.py" ].language, "Python" )
self.assertEquals( self.gist.files[ "fail_github.py" ].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n' )
self.assertEquals( self.gist.files[ "fail_github.py" ].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py" )
self.assertEquals( self.gist.forks, [] )
self.assertEquals( self.gist.git_pull_url, "git://gist.github.com/2729810.git" )
self.assertEquals( self.gist.git_push_url, "git@gist.github.com:2729810.git" )
self.assertEquals( len( self.gist.history ), 1 )
self.assertEquals( self.gist.history[ 0 ].change_status.additions, 52 )
self.assertEquals( self.gist.history[ 0 ].change_status.deletions, 0 )
self.assertEquals( self.gist.history[ 0 ].change_status.total, 52 )
self.assertEquals( self.gist.history[ 0 ].committed_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) )
self.assertEquals( self.gist.history[ 0 ].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e" )
self.assertEquals( self.gist.history[ 0 ].user.login, "jacquev6" )
self.assertEquals( self.gist.history[ 0 ].version, "a40de483e42ba33bda308371c0ef8383db73be9e" )
self.assertEquals( self.gist.html_url, "https://gist.github.com/2729810" )
self.assertEquals( self.gist.id, "2729810" )
self.assertEquals( self.gist.public, True )
self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) )
self.assertEquals( self.gist.url, "https://api.github.com/gists/2729810" )
self.assertEquals( self.gist.user.login, "jacquev6" )
def testEditWithoutParameters( self ):
self.gist.edit()
self.assertEquals( self.gist.description, "Gist created by PyGithub" )
self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 0, 58 ) )
def testEditWithAllParameters( self ):
self.gist.edit( "Description edited by PyGithub", { "barbaz.txt": github.InputFileContent( "File also created by PyGithub" ) } )
self.assertEquals( self.gist.description, "Description edited by PyGithub" )
self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 6, 10 ) )
self.assertEquals( self.gist.files.keys(), [ "foobar.txt", "barbaz.txt" ] )
def testCreateComment( self ):
comment = self.gist.create_comment( "Comment created by PyGithub" )
self.assertEquals( comment.id, 323629 )
def testGetComments( self ):
self.assertListKeyEqual( self.gist.get_comments(), lambda c: c.id, [ 323637 ] )
def testStarring( self ):
self.assertFalse( self.gist.is_starred() )
self.gist.set_starred()
self.assertTrue( self.gist.is_starred() )
self.gist.reset_starred()
self.assertFalse( self.gist.is_starred() )
def testFork( self ):
gist = self.g.get_gist( "2729818" ) # Random gist
myGist = gist.create_fork()
self.assertEquals( myGist.id, "2729865" )
self.assertEquals( myGist.fork_of, None ) # WTF
sameGist = self.g.get_gist( "2729865" )
self.assertEquals( sameGist.fork_of.id, "2729818" )
def testDelete( self ):
self.gist.delete()
+37
View File
@@ -0,0 +1,37 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class GistComment( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.comment = self.g.get_gist( "2729810" ).get_comment( 323629 )
def testAttributes( self ):
self.assertEquals( self.comment.body, "Comment created by PyGithub" )
self.assertEquals( self.comment.created_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) )
self.assertEquals( self.comment.id, 323629 )
self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) )
self.assertEquals( self.comment.url, "https://api.github.com/gists/comments/323629" )
self.assertEquals( self.comment.user.login, "jacquev6" )
def testEdit( self ):
self.comment.edit( "Comment edited by PyGithub" )
self.assertEquals( self.comment.body, "Comment edited by PyGithub" )
self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 12, 32 ) )
def testDelete( self ):
self.comment.delete()
+28
View File
@@ -0,0 +1,28 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class GitBlob( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.blob = self.g.get_user().get_repo( "PyGithub" ).get_git_blob( "53bce9fa919b4544e67275089b3ec5b44be20667" )
def testAttributes( self ):
self.assertTrue( self.blob.content.startswith( "IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgpmcm9tIGRpc3R1dGlscy5jb3JlIGlt\ncG9ydCBzZXR1cAppbXBvcnQgdGV4dHdyYXAKCnNldHVwKAogICAgbmFtZSA9\n" ) )
self.assertTrue( self.blob.content.endswith( "Z3JhbW1pbmcgTGFuZ3VhZ2UgOjogUHl0aG9uIiwKICAgICAgICAiVG9waWMg\nOjogU29mdHdhcmUgRGV2ZWxvcG1lbnQiLAogICAgXSwKKQo=\n" ) )
self.assertEqual( len( self.blob.content ), 1757 )
self.assertEqual( self.blob.encoding, "base64" )
self.assertEqual( self.blob.size, 1295 )
self.assertEqual( self.blob.sha, "53bce9fa919b4544e67275089b3ec5b44be20667" )
self.assertEqual( self.blob.url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/53bce9fa919b4544e67275089b3ec5b44be20667" )
+36
View File
@@ -0,0 +1,36 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import datetime
import Framework
class GitCommit( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.commit = self.g.get_user().get_repo( "PyGithub" ).get_git_commit( "4303c5b90e2216d927155e9609436ccb8984c495" )
def testAttributes( self ):
self.assertEqual( self.commit.author.name, "Vincent Jacques" )
self.assertEqual( self.commit.author.email, "vincent@vincent-jacques.net" )
self.assertEqual( self.commit.author.date, datetime.datetime( 2012, 4, 17, 17, 55, 16 ) )
self.assertEqual( self.commit.committer.name, "Vincent Jacques" )
self.assertEqual( self.commit.committer.email, "vincent@vincent-jacques.net" )
self.assertEqual( self.commit.committer.date, datetime.datetime( 2012, 4, 17, 17, 55, 16 ) )
self.assertEqual( self.commit.message, "Merge branch 'develop'\n" )
self.assertEqual( len( self.commit.parents ), 2 )
self.assertEqual( self.commit.parents[ 0 ].sha, "936f4a97f1a86392637ec002bbf89ff036a5062d" )
self.assertEqual( self.commit.parents[ 1 ].sha, "2a7e80e6421c5d4d201d60619068dea6bae612cb" )
self.assertEqual( self.commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495" )
self.assertEqual( self.commit.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad" )
self.assertEqual( self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495" )
+35
View File
@@ -0,0 +1,35 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class GitRef( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.ref = self.g.get_user().get_repo( "PyGithub" ).get_git_ref( "refs/heads/BranchCreatedByPyGithub" )
def testAttributes( self ):
self.assertEqual( self.ref.object.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.assertEqual( self.ref.object.type, "commit" )
self.assertEqual( self.ref.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" )
self.assertEqual( self.ref.ref, "refs/heads/BranchCreatedByPyGithub" )
self.assertEqual( self.ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub" )
def testEdit( self ):
self.ref.edit( "04cde900a0775b51f762735637bd30de392a2793" )
def testEditWithForce( self ):
self.ref.edit( "4303c5b90e2216d927155e9609436ccb8984c495", force = True )
def testDelete( self ):
self.ref.delete()
+33
View File
@@ -0,0 +1,33 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import datetime
import Framework
class GitTag( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.tag = self.g.get_user().get_repo( "PyGithub" ).get_git_tag( "f5f37322407b02a80de4526ad88d5f188977bc3c" )
def testAttributes( self ):
self.assertEqual( self.tag.message, "Version 0.6\n" )
self.assertEqual( self.tag.object.sha, "4303c5b90e2216d927155e9609436ccb8984c495" )
self.assertEqual( self.tag.object.type, "commit" )
self.assertEqual( self.tag.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495" )
self.assertEqual( self.tag.sha, "f5f37322407b02a80de4526ad88d5f188977bc3c" )
self.assertEqual( self.tag.tag, "v0.6" )
self.assertEqual( self.tag.tagger.date, datetime.datetime( 2012, 5, 10, 18, 14, 15 ) )
self.assertEqual( self.tag.tagger.email, "vincent@vincent-jacques.net" )
self.assertEqual( self.tag.tagger.name, "Vincent Jacques" )
self.assertEqual( self.tag.url, "https://api.github.com/repos/jacquev6/PyGithub/git/tags/f5f37322407b02a80de4526ad88d5f188977bc3c" )
+36
View File
@@ -0,0 +1,36 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class GitTree( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.tree = self.g.get_user().get_repo( "PyGithub" ).get_git_tree( "f492784d8ca837779650d1fb406a1a3587a764ad" )
def testAttributes( self ):
self.assertEqual( self.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad" )
self.assertEqual( len( self.tree.tree ), 11 )
self.assertEqual( self.tree.tree[ 0 ].mode, "100644" )
self.assertEqual( self.tree.tree[ 0 ].path, ".gitignore" )
self.assertEqual( self.tree.tree[ 0 ].sha, "8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd" )
self.assertEqual( self.tree.tree[ 0 ].size, 53 )
self.assertEqual( self.tree.tree[ 0 ].type, "blob" )
self.assertEqual( self.tree.tree[ 0 ].url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd" )
self.assertEqual( self.tree.tree[ 6 ].mode, "040000" )
self.assertEqual( self.tree.tree[ 6 ].path, "ReplayDataForIntegrationTest" )
self.assertEqual( self.tree.tree[ 6 ].sha, "60b4602b2c2070246c5df078fb7a5150b45815eb" )
self.assertEqual( self.tree.tree[ 6 ].size, None )
self.assertEqual( self.tree.tree[ 6 ].type, "tree" )
self.assertEqual( self.tree.tree[ 6 ].url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/60b4602b2c2070246c5df078fb7a5150b45815eb" )
self.assertEqual( self.tree.url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad" )
+91
View File
@@ -0,0 +1,91 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import datetime
import Framework
class Github( Framework.TestCase ):
def testGetGists( self ):
self.assertListKeyBegin( self.g.get_gists(), lambda g: g.id, [ "2729695", "2729656", "2729597", "2729584", "2729569", "2729554", "2729543", "2729537", "2729536", "2729533", "2729525", "2729522", "2729519", "2729515", "2729506", "2729487", "2729484", "2729482", "2729441", "2729432", "2729420", "2729398", "2729372", "2729371", "2729351", "2729346", "2729316", "2729304", "2729296", "2729276", "2729272", "2729265", "2729195", "2729160", "2729143", "2729127", "2729119", "2729113", "2729103", "2729069", "2729059", "2729051", "2729029", "2729027", "2729026", "2729022", "2729002", "2728985", "2728979", "2728964", "2728937", "2728933", "2728884", "2728869", "2728866", "2728855", "2728854", "2728853", "2728846", "2728825", "2728814", "2728813", "2728812", "2728805", "2728802", "2728800", "2728798", "2728797", "2728796", "2728793", "2728758", "2728754", "2728751", "2728748", "2728721", "2728716", "2728715", "2728705", "2728701", "2728699", "2728697", "2728688", "2728683", "2728677", "2728649", "2728640", "2728625", "2728620", "2728615", "2728614", "2728565", "2728564", "2728554", "2728523", "2728519", "2728511", "2728497", "2728496", "2728495", "2728487" ] )
def testLegacySearchRepos( self ):
repos = self.g.legacy_search_repos( "github api v3" )
self.assertListKeyBegin( repos, lambda r: r.name, [ "octokit", "github-v3-api", "github_v3_api" ] )
self.assertEqual( repos[ 0 ].full_name, "pengwynn/octokit" )
# Attributes retrieved from legacy API without lazy completion call
self.assertEqual( repos[ 1 ].created_at, datetime.datetime( 2011, 6, 23, 22, 52, 33 ) )
self.assertEqual( repos[ 1 ].name, "github-v3-api" )
self.assertEqual( repos[ 1 ].watchers, 35 )
self.assertEqual( repos[ 1 ].has_downloads, True )
self.assertEqual( repos[ 3 ].homepage, "http://peter-murach.github.com/github" )
self.assertEqual( repos[ 1 ].url, "/repos/jwilger/github-v3-api" )
self.assertEqual( repos[ 1 ].fork, False )
self.assertEqual( repos[ 1 ].has_issues, True )
self.assertEqual( repos[ 1 ].has_wiki, False )
self.assertEqual( repos[ 1 ].forks, 13 )
self.assertEqual( repos[ 1 ].size, 212 )
self.assertEqual( repos[ 1 ].private, False )
self.assertEqual( repos[ 1 ].open_issues, 2 )
self.assertEqual( repos[ 3 ].pushed_at, datetime.datetime( 2012, 6, 28, 21, 26, 31 ) )
self.assertEqual( repos[ 1 ].description, "Ruby Client for the GitHub v3 API" )
self.assertEqual( repos[ 1 ].language, "Ruby" )
self.assertEqual( repos[ 1 ].owner.login, "jwilger" )
self.assertEqual( repos[ 1 ].owner.url, "/users/jwilger" )
def testLegacySearchReposPagination( self ):
repos = self.g.legacy_search_repos( "document" )
self.assertListKeyBegin( repos, lambda r: r.name, [ "git", "nimbus", "kss", "sstoolkit", "lawnchair", "appledoc", "jQ.Mobi", "ipython", "mongoengine", "ravendb", "substance", "symfony-docs", "JavaScript-Garden", "DocSets-for-iOS", "yard", "phpDocumentor2", "phpsh", "Tangle", "Ingredients", "documentjs", "xhp", "couchdb-lucene", "dox", "magento2", "javascriptmvc", "FastPdfKit", "roar", "DocumentUp", "NoRM", "jsdoc", "tagger", "mongodb-csharp", "php-github-api", "beautiful-docs", "mongodb-odm", "iodocs", "seesaw", "bcx-api", "developer.github.com", "amqp", "docsplit", "pycco", "standards-and-practices", "tidy-html5", "redis-doc", "tomdoc", "docs", "flourish", "userguide", "swagger-ui", "rfc", "Weasel-Diesel", "yuidoc", "apigen", "document-viewer", "develop.github.com", "Shanty-Mongo", "PTShowcaseViewController", "gravatar_image_tag", "api-wow-docs", "mongoid-tree", "safari-json-formatter", "mayan", "orm-documentation", "jsfiddle-docs-alpha", "core", "documentcloud", "flexible-nav", "writeCapture", "readium", "xmldocument", "Documentation-Examples", "grails-doc", "stdeb", "aws-autoscaling", "voteable_mongo", "review", "spreadsheet_on_rails", "UKSyntaxColoredTextDocument", "mandango", "bdoc", "Documentation", "documents.com", "rghost", "ticket_mule", "vendo", "khan-api", "spring-data-document-examples", "rspec_api_documentation", "axlsx", "phpdox", "documentation", "Sami", "innershiv", "doxyclean", "documents", "rvm-site", "jqapi", "documentation", "hadoopy", "VichUploaderBundle", "pdoc", "documentation", "wii-js", "oss-docs", "scala-maven-plugin", "Documents", "documenter", "behemoth", "documentation", "documentation", "propelorm.github.com", "Kobold2D", "AutoObjectDocumentation", "php-mongodb-admin", "django-mongokit", "puppet-docs", "docs", "Document", "vendorer", "symfony1-docs", "shocco", "documentation", "jog", "docs", "documentation", "documentation", "documentation", "documentation", "Documentation", "documentation", "documentation", "phpunit-documentation", "ADCtheme", "NelmioApiDocBundle", "iCloud-Singleton-CloudMe", "Documentation", "document", "document_mapper", "heroku-docs", "couchdb-odm", "documentation", "documentation", "document", "documentation", "NanoStore", "documentation", "Documentation", "documentation", "Documentation", "documentation", "document", "documentation", "documentation", "Documentation", "Documentation", "grendel", "ceylon-compiler", "mbtiles-spec", "documentation", "documents", "documents", "Documents", "Documentation", "documentation", "Documentation", "documentation", "documents", "Documentation", "documentation", "documentation", "documents", "Documentation", "documentation", "documenter", "documentation", "documents", "Documents", "documents", "documents", "documentation", "Document", "document", "rdoc", "mongoid_token", "travis-ci.github.com", "Documents", "Documents", "documents", "Document", "Documentation", "documents", "Documents", "Documentation", "documents", "documents", "documents", "documentation", "Documents", "Document", "documents", "documents", "Documentation", "Documentation", "Document", "documents", "Documents", "Documents", "Documentation", "Documents", "documents", "Documents", "document", "documents", "Documentation", "Documents", "documents", "documents", "Documents", "documents", "Documentation", "documentation", "Document", "Documents", "documents", "documents", "documents", "Documentation", "Documentation", "Documents", "Documents", "Documents", "Documenter", "document", "Documentation", "Documents", "Documents", "documentation", "documentation", "Document", "Documents", "Documentation", "Documentation", "Documents", "documents", "Documents", "document", "documentation", "Documents", "documentation", "documentation", "documentation", "Documentation", "Documents", "Documents", "documentation", "Documents", "Documents", "documentation", "documentation", "documents", "Documentation", "documents", "documentation", "Documentation", "Documents", "documentation", "documentation", "documents", "documentation", "Umbraco5Docs", "documents", "Documents", "Documentation", "documents", "document", "documents", "document", "documents", "documentation", "Documents", "documents", "document", "Documents", "Documentation", "Documentation", "documentation", "Documentation", "document", "documentation", "documents", "documents", "Documentations", "document", "documentation", "Documentation", "Document", "Documents", "Documents", "Document" ] )
def testLegacySearchReposExplicitPagination( self ):
repos = self.g.legacy_search_repos( "python" )
self.assertEqual( [ r.name for r in repos.get_page( 4 ) ], [ "assetic", "cartodb", "cuisine", "gae-sessions", "geoalchemy2", "Multicorn", "wmfr-timeline", "redis-rdb-tools", "applet-workflows", "TweetBuff", "groovy-core", "StarTrekGame", "Nuevo", "Cupid", "node-sqlserver", "Magnet2Torrent", "GroundControl", "mock-django", "4bit", "mock-django", "Fabulous", "SFML", "pydicas", "flixel", "up", "mongrel2", "SimpleHTTPServerJs", "ultimos", "Archipel", "JSbooks", "nova", "nodebox", "simplehttp", "dablooms", "solarized", "landslide", "jQuery-File-Upload", "jQuery-File-Upload", "jQuery-File-Upload", "password-manager", "electrum", "twitter_nlp", "djangbone", "pyxfst", "node-gyp", "flare", "www.gittip.com", "wymeditor", "Kokobox", "MyCQ", "runwalk", "git-sweep", "HPCPythonSC2012", "sundown", "node2dm", "statirator", "fantastic-futures", "chainsaw", "itcursos-gerenciador-tarefas", "TideSDK", "genmaybot", "melpa", "ConnectedWire", "tarantool", "anserindicus_sn", "luvit", "Minecraft-Overviewer", "Iconic", "pyist.net", "wikibok", "mejorenvo-scraper", "NewsBlur", "SocketRocket", "spf13-vim", "IWantToWorkAtGloboCom", "ruby-style-guide", "aery32-refguide", "fafsite", "compsense_demo", "enaml", "mpi4py", "fi.pycon.org", "scikits-image", "scikits-image", "uni", "mako.vim", "mako.vim", "slumber", "de-composer", "nvm", "helloshopply", "Alianza", "vimfiles", "socorro-crashstats", "menu", "analytics", "elFinder", "riak_wiki", "livestreamer", "git-goggles" ] )
def testLegacySearchReposWithLanguage( self ):
repos = self.g.legacy_search_repos( "document", language = "Python" )
self.assertListKeyBegin( repos, lambda r: r.name, [ "ipython", "mongoengine", "tagger" ] )
self.assertEqual( repos[ 0 ].full_name, "ipython/ipython" )
def testLegacySearchUsers( self ):
users = self.g.legacy_search_users( "vincent" )
self.assertListKeyBegin( users, lambda u: u.login, [ "nvie", "obra", "lusis" ] )
# Attributes retrieved from legacy API without lazy completion call
self.assertEqual( users[ 0 ].gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a" )
self.assertEqual( users[ 0 ].name, "Vincent Driessen" )
self.assertEqual( users[ 0 ].created_at, datetime.datetime( 2009, 5, 12, 21, 19, 38 ) )
self.assertEqual( users[ 0 ].location, "Netherlands" )
self.assertEqual( users[ 0 ].followers, 310 )
self.assertEqual( users[ 0 ].public_repos, 63 )
self.assertEqual( users[ 0 ].login, "nvie" )
def testLegacySearchUsersPagination( self ):
self.assertEqual( len( list( self.g.legacy_search_users( "Lucy" ) ) ), 146 )
def testLegacySearchUsersExplicitPagination( self ):
users = self.g.legacy_search_users( "Lucy" )
self.assertEqual( [ u.login for u in users.get_page( 1 ) ], [ "lucievh", "lucyim", "Lucief", "RevolverUpstairs", "seriousprogramming", "reicul", "davincidubai", "LucianaNascimentodoPrado", "lucia-huenchunao", "kraji20", "Lucywolo", "Luciel", "sunnysummer", "elush", "oprealuci", "Flika", "lsher", "datadrivenjournalism", "nill2020", "doobi", "lucilu", "deldeldel", "lucianacocca", "lucyli-sfdc", "lucysatchell", "UBM", "kolousek", "lucyzhang", "lmegia", "luisolivo", "Lucyzhen", "Luhzinha", "beautifly", "lucybm96", "BuonocoreL", "lucywilliams", "ZxOxZ", "Motwinb", "johnlucy", "Aquanimation", "alaltaieri", "lucylin", "lucychambers", "JuanSesma", "cdwwebware", "ZachWills" ] )
def testLegacySearchUserByEmail( self ):
user = self.g.legacy_search_user_by_email( "vincent@vincent-jacques.net" )
self.assertEqual( user.login, "jacquev6" )
self.assertEqual( user.followers, 13 )
def testGetHooks( self ):
hooks = self.g.get_hooks()
hook = hooks[ 0 ]
self.assertEqual( hook.name, "activecollab" )
self.assertEqual( hook.supported_events, [ "push" ] )
self.assertEqual( hook.events, [ "push" ] )
self.assertEqual( hook.schema, [ [ "string", "url" ], [ "string", "token" ], [ "string", "project_id" ], [ "string", "milestone_id" ], [ "string", "category_id" ] ] )
+55
View File
@@ -0,0 +1,55 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Hook( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.hook = self.g.get_user().get_repo( "PyGithub" ).get_hook( 257993 )
def testAttributes( self ):
self.assertEqual( self.hook.active, True ) # WTF
self.assertEqual( self.hook.config, { "url": "http://foobar.com" } )
self.assertEqual( self.hook.created_at, datetime.datetime( 2012, 5, 19, 6, 1, 45 ) )
self.assertEqual( self.hook.events, [ "push" ] )
self.assertEqual( self.hook.id, 257993 )
self.assertEqual( self.hook.last_response.status, "ok" )
self.assertEqual( self.hook.last_response.message, "OK" )
self.assertEqual( self.hook.last_response.code, 200 )
self.assertEqual( self.hook.name, "web" )
self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 29, 18, 49, 47 ) )
self.assertEqual( self.hook.url, "https://api.github.com/repos/jacquev6/PyGithub/hooks/257993" )
def testEditWithMinimalParameters( self ):
self.hook.edit( "web", { "url": "http://foobar.com/hook" } )
self.assertEqual( self.hook.config, { "url": "http://foobar.com/hook" } )
self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 19, 5, 8, 16 ) )
def testDelete( self ):
self.hook.delete()
def testTest( self ):
self.hook.test() # This does not update attributes of hook
def testEditWithAllParameters( self ):
self.hook.edit( "web", { "url": "http://foobar.com" }, events = [ "fork", "push" ] )
self.assertEqual( self.hook.events, [ "fork", "push" ] )
self.hook.edit( "web", { "url": "http://foobar.com" }, add_events = [ "push" ] )
self.assertEqual( self.hook.events, [ "fork", "push" ] )
self.hook.edit( "web", { "url": "http://foobar.com" }, remove_events = [ "fork" ] )
self.assertEqual( self.hook.events, [ "push" ] )
self.hook.edit( "web", { "url": "http://foobar.com" }, active = True )
self.assertEqual( self.hook.active, True )
+63
View File
@@ -0,0 +1,63 @@
#!/bin/env python
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
from AuthenticatedUser import *
from Authentication import *
from Authorization import *
from Branch import *
from Commit import *
from CommitComment import *
from CommitStatus import *
from ContentFile import *
from Download import *
from Event import *
from Gist import *
from GistComment import *
from GitBlob import *
from GitCommit import *
from Github import *
from GitRef import *
from GitTag import *
from GitTree import *
from Hook import *
from Issue import *
from IssueComment import *
from IssueEvent import *
from Label import *
from Milestone import *
from NamedUser import *
from Organization import *
from PullRequest import *
from PullRequestComment import *
from PullRequestFile import *
from RateLimiting import *
from Repository import *
from RepositoryKey import *
from Tag import *
from Team import *
from UserKey import *
from Markdown import *
from PaginatedList import *
from Issue33 import *
from Issue50 import *
from Issue54 import *
from Exceptions import *
from Enterprise import *
from Issue80 import *
Framework.main()
+99
View File
@@ -0,0 +1,99 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Issue( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.repo = self.g.get_user().get_repo( "PyGithub" )
self.issue = self.repo.get_issue( 28 )
def testAttributes( self ):
self.assertEqual( self.issue.assignee.login, "jacquev6" )
self.assertEqual( self.issue.body, "Body edited by PyGithub" )
self.assertEqual( self.issue.closed_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) )
self.assertEqual( self.issue.closed_by.login, "jacquev6" )
self.assertEqual( self.issue.comments, 0 )
self.assertEqual( self.issue.created_at, datetime.datetime( 2012, 5, 19, 10, 38, 23 ) )
self.assertEqual( self.issue.html_url, "https://github.com/jacquev6/PyGithub/issues/28" )
self.assertEqual( self.issue.id, 4653757 )
self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", "Project management", "Question" ] )
self.assertEqual( self.issue.milestone.title, "Version 0.4" )
self.assertEqual( self.issue.number, 28 )
self.assertEqual( self.issue.pull_request.diff_url, None )
self.assertEqual( self.issue.pull_request.patch_url, None )
self.assertEqual( self.issue.pull_request.html_url, None )
self.assertEqual( self.issue.state, "closed" )
self.assertEqual( self.issue.title, "Issue created by PyGithub" )
self.assertEqual( self.issue.updated_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) )
self.assertEqual( self.issue.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/28" )
self.assertEqual( self.issue.user.login, "jacquev6" )
def testEditWithoutParameters( self ):
self.issue.edit()
def testEditWithAllParameters( self ):
user = self.g.get_user( "jacquev6" )
milestone = self.repo.get_milestone( 2 )
self.issue.edit( "Title edited by PyGithub", "Body edited by PyGithub", user, "open", milestone, [ "Bug" ] )
self.assertEqual( self.issue.assignee.login, "jacquev6" )
self.assertEqual( self.issue.body, "Body edited by PyGithub" )
self.assertEqual( self.issue.state, "open" )
self.assertEqual( self.issue.title, "Title edited by PyGithub" )
self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug" ] )
def testEditResetMilestone( self ):
self.assertEqual( self.issue.milestone.title, "Version 0.4" )
self.issue.edit( milestone = None )
self.assertEqual( self.issue.milestone, None )
def testEditResetAssignee( self ):
self.assertEqual( self.issue.assignee.login, "jacquev6" )
self.issue.edit( assignee = None )
self.assertEqual( self.issue.assignee, None )
def testCreateComment( self ):
comment = self.issue.create_comment( "Comment created by PyGithub" )
self.assertEqual( comment.id, 5808311 )
def testGetComments( self ):
self.assertListKeyEqual( self.issue.get_comments(), lambda c: c.user.login, [ "jacquev6", "roskakori" ] )
def testGetEvents( self ):
self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )
def testGetLabels( self ):
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] )
def testAddAndRemoveLabels( self ):
bug = self.repo.get_label( "Bug" )
question = self.repo.get_label( "Question" )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] )
self.issue.remove_from_labels( bug )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Project management", "Question" ] )
self.issue.remove_from_labels( question )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Project management" ] )
self.issue.add_to_labels( bug, question )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] )
def testDeleteAndSetLabels( self ):
bug = self.repo.get_label( "Bug" )
question = self.repo.get_label( "Question" )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] )
self.issue.delete_labels()
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )
self.issue.set_labels( bug, question )
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Question" ] )
+25
View File
@@ -0,0 +1,25 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class Issue33( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issues/33
def setUp( self ):
Framework.TestCase.setUp( self )
self.repo = self.g.get_user( "openframeworks" ).get_repo( "openFrameworks" )
def testOpenIssues( self ):
self.assertEqual( len( list( self.repo.get_issues() ) ), 338 )
def testClosedIssues( self ):
self.assertEqual( len( list( self.repo.get_issues( state = "closed" ) ) ), 950 )
+57
View File
@@ -0,0 +1,57 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import github
import Framework
class Issue50( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issues/50
def setUp( self ):
Framework.TestCase.setUp( self )
self.repo = self.g.get_user().get_repo( "PyGithub" )
self.issue = self.repo.get_issue( 50 )
self.labelName = "Label with spaces and strange characters (&*#$)"
def testCreateLabel( self ):
label = self.repo.create_label( self.labelName, "ffff00" )
self.assertEqual( label.name, self.labelName )
def testGetLabel( self ):
label = self.repo.get_label( self.labelName )
self.assertEqual( label.name, self.labelName )
def testGetLabels( self ):
self.assertListKeyEqual( self.repo.get_labels(), lambda l: l.name, [ "Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question", "RequestedByUser", self.labelName ] )
def testAddLabelToIssue( self ):
self.issue.add_to_labels( self.repo.get_label( self.labelName ) )
def testRemoveLabelFromIssue( self ):
self.issue.remove_from_labels( self.repo.get_label( self.labelName ) )
def testSetIssueLabels( self ):
self.issue.set_labels( self.repo.get_label( "Bug" ), self.repo.get_label( "RequestedByUser" ), self.repo.get_label( self.labelName ) )
def testIssueLabels( self ):
self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", self.labelName, "RequestedByUser" ] )
def testIssueGetLabels( self ):
self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", self.labelName, "RequestedByUser" ] )
def testGetIssuesWithLabel( self ):
self.assertListKeyEqual( self.repo.get_issues( labels = [ self.repo.get_label( self.labelName ) ] ), lambda i: i.number, [ 52, 50 ] )
def testCreateIssueWithLabel( self ):
issue = self.repo.create_issue( "Issue created by PyGithub to test issue #50", labels = [ self.repo.get_label( self.labelName ) ] )
self.assertListKeyEqual( issue.labels, lambda l: l.name, [ self.labelName ] )
self.assertEqual( issue.number, 52 )
+26
View File
@@ -0,0 +1,26 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import datetime
import Framework
class Issue54( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.repo = self.g.get_user().get_repo( "TestRepo" )
def testConversion( self ):
commit = self.repo.get_git_commit( "73f320ae06cd565cf38faca34b6a482addfc721b" )
self.assertEqual( commit.message, "Test commit created around Fri, 13 Jul 2012 18:43:21 GMT, that is vendredi 13 juillet 2012 20:43:21 GMT+2\n" )
self.assertEqual( commit.author.date, datetime.datetime( 2012, 7, 13, 18, 47, 10 ) )
+29
View File
@@ -0,0 +1,29 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import github
import Framework
class Issue80( Framework.BasicTestCase ): # https://github.com/jacquev6/PyGithub/issues/80
def testIgnoreHttpsFromGithubEnterprise( self ):
g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com/some/prefix" ) # http here
org = g.get_organization( "BeaverSoftware" )
self.assertEqual( org.url, "https://my.enterprise.com/some/prefix/orgs/BeaverSoftware" ) # https returned
self.assertListKeyEqual( org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] ) # But still http in second request based on org.url
def testIgnoreHttpsFromGithubEnterpriseWithPort( self ):
g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com:1234/some/prefix" ) # http here
org = g.get_organization( "BeaverSoftware" )
self.assertEqual( org.url, "https://my.enterprise.com:1234/some/prefix/orgs/BeaverSoftware" ) # https returned
self.assertListKeyEqual( org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] ) # But still http in second request based on org.url
+37
View File
@@ -0,0 +1,37 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class IssueComment( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.comment = self.g.get_user().get_repo( "PyGithub" ).get_issue( 28 ).get_comment( 5808311 )
def testAttributes( self ):
self.assertEqual( self.comment.body, "Comment created by PyGithub" )
self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) )
self.assertEqual( self.comment.id, 5808311 )
self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) )
self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311" )
self.assertEqual( self.comment.user.login, "jacquev6" )
def testEdit( self ):
self.comment.edit( "Comment edited by PyGithub" )
self.assertEqual( self.comment.body, "Comment edited by PyGithub" )
self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 53, 59 ) )
def testDelete( self ):
self.comment.delete()
+30
View File
@@ -0,0 +1,30 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class IssueEvent( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.event = self.g.get_user().get_repo( "PyGithub" ).get_issues_event( 16348656 )
def testAttributes( self ):
self.assertEqual( self.event.actor.login, "jacquev6" )
self.assertEqual( self.event.commit_id, "ed866fc43833802ab553e5ff8581c81bb00dd433" )
self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 27, 7, 29, 25 ) )
self.assertEqual( self.event.event, "referenced" )
self.assertEqual( self.event.id, 16348656 )
self.assertEqual( self.event.issue.number, 30 )
self.assertEqual( self.event.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656" )
+33
View File
@@ -0,0 +1,33 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class Label( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.label = self.g.get_user().get_repo( "PyGithub" ).get_label( "Bug" )
def testAttributes( self ):
self.assertEqual( self.label.color, "e10c02" )
self.assertEqual( self.label.name, "Bug" )
self.assertEqual( self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Bug" )
def testEdit( self ):
self.label.edit( "LabelEditedByPyGithub", "0000ff" )
self.assertEqual( self.label.color, "0000ff" )
self.assertEqual( self.label.name, "LabelEditedByPyGithub" )
self.assertEqual( self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/LabelEditedByPyGithub" )
def testDelete( self ):
self.label.delete()
+26
View File
@@ -0,0 +1,26 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class Markdown( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.text = "MyTitle\n=======\n\nIssue #1"
self.repo = self.g.get_user().get_repo( "PyGithub" )
def testRenderMarkdown( self ):
self.assertEqual( self.g.render_markdown( self.text ), '<h1><a name="mytitle" class="anchor" href="#mytitle"><span class="mini-icon mini-icon-link"></span></a>MyTitle</h1><p>Issue #1</p>' )
def testRenderGithubFlavoredMarkdown( self ):
self.assertEqual( self.g.render_markdown( self.text, self.repo ), '<h1>MyTitle</h1><p>Issue <a href="https://github.com/jacquev6/PyGithub/issues/1" class="issue-link" title="Gitub -&gt; Github everywhere">#1</a></p>' )
+51
View File
@@ -0,0 +1,51 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Milestone( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.milestone = self.g.get_user().get_repo( "PyGithub" ).get_milestone( 1 )
def testAttributes( self ):
self.assertEqual( self.milestone.closed_issues, 2 )
self.assertEqual( self.milestone.created_at, datetime.datetime( 2012, 3, 8, 12, 22, 10 ) )
self.assertEqual( self.milestone.description, "" )
self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 3, 13, 7, 0, 0 ) )
self.assertEqual( self.milestone.id, 93546 )
self.assertEqual( self.milestone.number, 1 )
self.assertEqual( self.milestone.open_issues, 0 )
self.assertEqual( self.milestone.state, "closed" )
self.assertEqual( self.milestone.title, "Version 0.4" )
self.assertEqual( self.milestone.url, "https://api.github.com/repos/jacquev6/PyGithub/milestones/1" )
self.assertEqual( self.milestone.creator.login, "jacquev6" )
def testEditWithMinimalParameters( self ):
self.milestone.edit( "Title edited by PyGithub" )
self.assertEqual( self.milestone.title, "Title edited by PyGithub" )
def testEditWithAllParameters( self ):
self.milestone.edit( "Title edited twice by PyGithub", "closed", "Description edited by PyGithub", due_on = datetime.date( 2012, 6, 16 ) )
self.assertEqual( self.milestone.title, "Title edited twice by PyGithub" )
self.assertEqual( self.milestone.state, "closed" )
self.assertEqual( self.milestone.description, "Description edited by PyGithub" )
self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 6, 16, 7, 0, 0 ) )
def testGetLabels( self ):
self.assertListKeyEqual( self.milestone.get_labels(), lambda l: l.name, [ "Public interface", "Project management" ] )
def testDelete( self ):
self.milestone.delete()
+130
View File
@@ -0,0 +1,130 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import github
import datetime
class NamedUser( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.user = self.g.get_user( "jacquev6" )
def testAttributesOfOtherUser( self ):
self.user = self.g.get_user( "nvie" )
self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" )
self.assertEqual( self.user.bio, None )
self.assertEqual( self.user.blog, "http://nvie.com" )
self.assertEqual( self.user.collaborators, None )
self.assertEqual( self.user.company, "3rd Cloud" )
self.assertEqual( self.user.created_at, datetime.datetime( 2009, 5, 12, 21, 19, 38 ) )
self.assertEqual( self.user.disk_usage, None )
self.assertEqual( self.user.email, "vincent@3rdcloud.com" )
self.assertEqual( self.user.followers, 296 )
self.assertEqual( self.user.following, 41 )
self.assertEqual( self.user.gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a" )
self.assertEqual( self.user.hireable, False )
self.assertEqual( self.user.html_url, "https://github.com/nvie" )
self.assertEqual( self.user.id, 83844 )
self.assertEqual( self.user.location, "Netherlands" )
self.assertEqual( self.user.login, "nvie" )
self.assertEqual( self.user.name, "Vincent Driessen" )
self.assertEqual( self.user.owned_private_repos, None )
self.assertEqual( self.user.plan, None )
self.assertEqual( self.user.private_gists, None )
self.assertEqual( self.user.public_gists, 16 )
self.assertEqual( self.user.public_repos, 61 )
self.assertEqual( self.user.total_private_repos, None )
self.assertEqual( self.user.type, "User" )
self.assertEqual( self.user.url, "https://api.github.com/users/nvie" )
def testAttributesOfSelf( self ):
self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" )
self.assertEqual( self.user.bio, "" )
self.assertEqual( self.user.blog, "http://vincent-jacques.net" )
self.assertEqual( self.user.collaborators, 0 )
self.assertEqual( self.user.company, "Criteo" )
self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) )
self.assertEqual( self.user.disk_usage, 17080 )
self.assertEqual( self.user.email, "vincent@vincent-jacques.net" )
self.assertEqual( self.user.followers, 13 )
self.assertEqual( self.user.following, 24 )
self.assertEqual( self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225" )
self.assertEqual( self.user.hireable, False )
self.assertEqual( self.user.html_url, "https://github.com/jacquev6" )
self.assertEqual( self.user.id, 327146 )
self.assertEqual( self.user.location, "Paris, France" )
self.assertEqual( self.user.login, "jacquev6" )
self.assertEqual( self.user.name, "Vincent Jacques" )
self.assertEqual( self.user.owned_private_repos, 5 )
self.assertEqual( self.user.plan.name, "micro" )
self.assertEqual( self.user.plan.collaborators, 1 )
self.assertEqual( self.user.plan.space, 614400 )
self.assertEqual( self.user.plan.private_repos, 5 )
self.assertEqual( self.user.private_gists, 5 )
self.assertEqual( self.user.public_gists, 2 )
self.assertEqual( self.user.public_repos, 11 )
self.assertEqual( self.user.total_private_repos, 5 )
self.assertEqual( self.user.type, "User" )
self.assertEqual( self.user.url, "https://api.github.com/users/jacquev6" )
def testCreateGist( self ):
gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) }, "Gist created by PyGithub on a NamedUser" )
self.assertEqual( gist.description, "Gist created by PyGithub on a NamedUser" )
def testCreateGistWithoutDescription( self ):
gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) } )
self.assertEqual( gist.description, None )
def testGetGists( self ):
self.assertListKeyEqual( self.user.get_gists(), lambda g: g.description, [ "Gist created by PyGithub", "FairThreadPoolPool.cpp", "How to error 500 Github API v3, as requested by Rick (GitHub Staff)", "Cadfael: order of episodes in French DVD edition" ] )
def testGetFollowers( self ):
self.assertListKeyEqual( self.user.get_followers(), lambda f: f.login, [ "jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y" ] )
def testGetFollowing( self ):
self.assertListKeyEqual( self.user.get_following(), lambda f: f.login, [ "nvie", "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa" ] )
def testGetOrgs( self ):
self.assertListKeyEqual( self.user.get_orgs(), lambda o: o.login, [ "BeaverSoftware" ] )
def testGetRepo( self ):
self.assertEqual( self.user.get_repo( "PyGithub" ).description, "Python library implementing the full Github API v3" )
def testGetRepos( self ):
self.assertListKeyEqual( self.user.get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] )
def testGetReposWithType( self ):
self.assertListKeyEqual( self.user.get_repos( "owner" ), lambda r: r.name, [ "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] )
def testGetWatched( self ):
self.assertListKeyEqual( self.user.get_watched(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub" ] )
def testGetStarred( self ):
self.assertListKeyEqual( self.user.get_starred(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly" ] )
def testGetSubscriptions( self ):
self.assertListKeyEqual( self.user.get_subscriptions(), lambda r: r.name, [ "ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub" ] )
def testGetEvents( self ):
self.assertListKeyBegin( self.user.get_events(), lambda e: e.type, [ "GistEvent", "IssueCommentEvent", "PushEvent", "IssuesEvent" ] )
def testGetPublicEvents( self ):
self.assertListKeyBegin( self.user.get_public_events(), lambda e: e.type, [ "PushEvent", "CreateEvent", "GistEvent", "IssuesEvent" ] )
def testGetPublicReceivedEvents( self ):
self.assertListKeyBegin( self.user.get_public_received_events(), lambda e: e.type, [ "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent" ] )
def testGetReceivedEvents( self ):
self.assertListKeyBegin( self.user.get_received_events(), lambda e: e.type, [ "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent" ] )
+116
View File
@@ -0,0 +1,116 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class Organization( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.org = self.g.get_organization( "BeaverSoftware" )
def testAttributes( self ):
self.assertEqual( self.org.avatar_url, "https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png" )
self.assertEqual( self.org.billing_email, "BeaverSoftware@vincent-jacques.net" )
self.assertEqual( self.org.blog, None )
self.assertEqual( self.org.collaborators, 0 )
self.assertEqual( self.org.company, None )
self.assertEqual( self.org.created_at, datetime.datetime( 2012, 2, 9, 19, 20, 12 ) )
self.assertEqual( self.org.disk_usage, 112 )
self.assertEqual( self.org.email, None )
self.assertEqual( self.org.followers, 0 )
self.assertEqual( self.org.following, 0 )
self.assertEqual( self.org.gravatar_id, None )
self.assertEqual( self.org.html_url, "https://github.com/BeaverSoftware" )
self.assertEqual( self.org.id, 1424031 )
self.assertEqual( self.org.location, "Paris, France" )
self.assertEqual( self.org.login, "BeaverSoftware" )
self.assertEqual( self.org.name, None )
self.assertEqual( self.org.owned_private_repos, 0 )
self.assertEqual( self.org.plan.name, "free" )
self.assertEqual( self.org.plan.private_repos, 0 )
self.assertEqual( self.org.plan.space, 307200 )
self.assertEqual( self.org.private_gists, 0 )
self.assertEqual( self.org.public_gists, 0 )
self.assertEqual( self.org.public_repos, 2 )
self.assertEqual( self.org.total_private_repos, 0 )
self.assertEqual( self.org.type, "Organization" )
self.assertEqual( self.org.url, "https://api.github.com/orgs/BeaverSoftware" )
def testEditWithoutArguments( self ):
self.org.edit()
def testEditWithAllArguments( self ):
self.org.edit( "BeaverSoftware2@vincent-jacques.net", "http://vincent-jacques.net", "Company edited by PyGithub", "BeaverSoftware2@vincent-jacques.net", "Location edited by PyGithub", "Name edited by PyGithub" )
self.assertEqual( self.org.billing_email, "BeaverSoftware2@vincent-jacques.net" )
self.assertEqual( self.org.blog, "http://vincent-jacques.net" )
self.assertEqual( self.org.company, "Company edited by PyGithub" )
self.assertEqual( self.org.email, "BeaverSoftware2@vincent-jacques.net" )
self.assertEqual( self.org.location, "Location edited by PyGithub" )
self.assertEqual( self.org.name, "Name edited by PyGithub" )
def testCreateTeam( self ):
team = self.org.create_team( "Team created by PyGithub" )
self.assertEqual( team.id, 189850 )
def testCreateTeamWithAllArguments( self ):
repo = self.org.get_repo( "FatherBeaver" )
team = self.org.create_team( "Team also created by PyGithub", [ repo ], "push" )
self.assertEqual( team.id, 189852 )
def testPublicMembers( self ):
lyloa = self.g.get_user( "Lyloa" )
self.assertFalse( self.org.has_in_public_members( lyloa ) )
self.org.add_to_public_members( lyloa )
self.assertTrue( self.org.has_in_public_members( lyloa ) )
self.org.remove_from_public_members( lyloa )
self.assertFalse( self.org.has_in_public_members( lyloa ) )
def testGetPublicMembers( self ):
self.assertListKeyEqual( self.org.get_public_members(), lambda u: u.login, [ "jacquev6" ] )
def testGetMembers( self ):
self.assertListKeyEqual( self.org.get_members(), lambda u: u.login, [ "cjuniet", "jacquev6", "Lyloa" ] )
def testMembers( self ):
lyloa = self.g.get_user( "Lyloa" )
self.assertTrue( self.org.has_in_members( lyloa ) )
self.org.remove_from_members( lyloa )
self.assertFalse( self.org.has_in_members( lyloa ) )
def testGetRepos( self ):
self.assertListKeyEqual( self.org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] )
def testGetReposWithType( self ):
self.assertListKeyEqual( self.org.get_repos( "public" ), lambda r: r.name, [ "FatherBeaver", "PyGithub" ] )
def testGetEvents( self ):
self.assertListKeyEqual( self.org.get_events(), lambda e: e.type, [ "CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "PushEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "ForkEvent", "CreateEvent" ] )
def testGetTeams( self ):
self.assertListKeyEqual( self.org.get_teams(), lambda t: t.name, [ "Members", "Owners" ] )
def testCreateRepoWithMinimalArguments( self ):
repo = self.org.create_repo( "TestPyGithub" )
self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub" )
def testCreateRepoWithAllArguments( self ):
team = self.org.get_team( 141496 )
repo = self.org.create_repo( "TestPyGithub2", "Repo created by PyGithub", "http://foobar.com", False, False, False, False, team )
self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub2" )
def testCreateFork( self ):
pygithub = self.g.get_user( "jacquev6" ).get_repo( "PyGithub" )
repo = self.org.create_fork( pygithub )
self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/PyGithub" )
+79
View File
@@ -0,0 +1,79 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class PaginatedList( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.list = self.g.get_user( "openframeworks" ).get_repo( "openFrameworks" ).get_issues()
def testIteration( self ):
self.assertEqual( len( list( self.list ) ), 333 )
def testSeveralIterations( self ):
self.assertEqual( len( list( self.list ) ), 333 )
self.assertEqual( len( list( self.list ) ), 333 )
self.assertEqual( len( list( self.list ) ), 333 )
self.assertEqual( len( list( self.list ) ), 333 )
def testIntIndexingInFirstPage( self ):
self.assertEqual( self.list[ 0 ].id, 4772349 )
self.assertEqual( self.list[ 24 ].id, 4286936 )
def testIntIndexingInThirdPage( self ):
self.assertEqual( self.list[ 50 ].id, 3911629 )
self.assertEqual( self.list[ 74 ].id, 3605277 )
def testGetFirstPage( self ):
self.assertListKeyEqual( self.list.get_page( 0 ), lambda i: i.id, [ 4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492, 4507416, 4447561, 4406584, 4384548, 4383465, 4373361, 4373201, 4370619, 4356530, 4352401, 4317009, 4286936 ] )
def testGetThirdPage( self ):
self.assertListKeyEqual( self.list.get_page( 2 ), lambda i: i.id, [ 3911629, 3911537, 3910580, 3910555, 3910549, 3897090, 3883598, 3856005, 3850655, 3825582, 3813852, 3812318, 3812275, 3807459, 3799872, 3799653, 3795495, 3754055, 3710293, 3662214, 3647640, 3631618, 3627067, 3614231, 3605277 ] )
def testIntIndexingAfterIteration( self ):
self.assertEqual( len( list( self.list ) ), 333 )
self.assertEqual( self.list[ 11 ].id, 4507572 )
self.assertEqual( self.list[ 73 ].id, 3614231 )
self.assertEqual( self.list[ 332 ].id, 94898 )
def testSliceIndexingInFirstPage( self ):
self.assertListKeyEqual( self.list[ : 13 ], lambda i: i.id, [ 4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492 ] )
self.assertListKeyEqual( self.list[ : 13 : 3 ], lambda i: i.id, [ 4772349, 4700182, 4604661, 4554058, 4507492 ] )
self.assertListKeyEqual( self.list[ 10 : 13 ], lambda i: i.id, [ 4539985, 4507572, 4507492 ] )
self.assertListKeyEqual( self.list[ 5 : 13 : 3 ], lambda i: i.id, [ 4608132, 4557803, 4507572 ] )
def testSliceIndexingUntilFourthPage( self ):
self.assertListKeyEqual( self.list[ : 99 : 10 ], lambda i: i.id, [ 4772349, 4539985, 4370619, 4207350, 4063366, 3911629, 3813852, 3647640, 3528378, 3438233 ] )
self.assertListKeyEqual( self.list[ 73 : 78 ], lambda i: i.id, [ 3614231, 3605277, 3596240, 3594731, 3593619 ] )
self.assertListKeyEqual( self.list[ 70 : 80 : 2 ], lambda i: i.id, [ 3647640, 3627067, 3605277, 3594731, 3593430 ] )
def testSliceIndexingUntilEnd( self ):
self.assertListKeyEqual( self.list[ 310 : : 3 ], lambda i: i.id, [ 268332, 204247, 169176, 166211, 165898, 163959, 132373, 104702 ] )
self.assertListKeyEqual( self.list[ 310 : ], lambda i: i.id, [ 268332, 211418, 205935, 204247, 172424, 171615, 169176, 166214, 166212, 166211, 166209, 166208, 165898, 165537, 165409, 163959, 132671, 132377, 132373, 130269, 111018, 104702, 94898 ] )
def testInterruptedIteration( self ):
# No asserts, but checks that only three pages are fetched
l = 0
for element in self.list:
l += 1
if l == 75:
break
def testInterruptedIterationInSlice( self ):
# No asserts, but checks that only three pages are fetched
l = 0
for element in self.list[ :100 ]:
l += 1
if l == 75:
break
+99
View File
@@ -0,0 +1,99 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class PullRequest( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.repo = self.g.get_user().get_repo( "PyGithub" )
self.pull = self.repo.get_pull( 31 )
def testAttributes( self ):
self.assertEqual( self.pull.additions, 511 )
self.assertEqual( self.pull.base.label, "jacquev6:topic/RewriteWithGeneratedCode" )
self.assertEqual( self.pull.base.sha, "ed866fc43833802ab553e5ff8581c81bb00dd433" )
self.assertEqual( self.pull.base.user.login, "jacquev6" )
self.assertEqual( self.pull.base.ref, "topic/RewriteWithGeneratedCode" )
self.assertEqual( self.pull.base.repo.full_name, "jacquev6/PyGithub" )
self.assertEqual( self.pull.body, "Body edited by PyGithub" )
self.assertEqual( self.pull.changed_files, 45 )
self.assertEqual( self.pull.closed_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) )
self.assertEqual( self.pull.comments, 0 )
self.assertEqual( self.pull.commits, 3 )
self.assertEqual( self.pull.created_at, datetime.datetime( 2012, 5, 27, 9, 25, 36 ) )
self.assertEqual( self.pull.deletions, 384 )
self.assertEqual( self.pull.diff_url, "https://github.com/jacquev6/PyGithub/pull/31.diff" )
self.assertEqual( self.pull.head.label, "BeaverSoftware:master" )
self.assertEqual( self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31" )
self.assertEqual( self.pull.id, 1436215 )
self.assertEqual( self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31" )
self.assertEqual( self.pull.mergeable, None )
self.assertEqual( self.pull.merged, True )
self.assertEqual( self.pull.merged_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) )
self.assertEqual( self.pull.merged_by.login, "jacquev6" )
self.assertEqual( self.pull.number, 31 )
self.assertEqual( self.pull.patch_url, "https://github.com/jacquev6/PyGithub/pull/31.patch" )
self.assertEqual( self.pull.review_comments, 1 )
self.assertEqual( self.pull.state, "closed" )
self.assertEqual( self.pull.title, "Title edited by PyGithub" )
self.assertEqual( self.pull.updated_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) )
self.assertEqual( self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31" )
self.assertEqual( self.pull.user.login, "jacquev6" )
def testCreateComment( self ):
commit = self.repo.get_commit( "8a4f306d4b223682dd19410d4a9150636ebe4206" )
comment = self.pull.create_comment( "Comment created by PyGithub", commit, "src/github/Issue.py", 5 )
self.assertEqual( comment.id, 886298 )
def testGetComments( self ):
self.assertListKeyEqual( self.pull.get_comments(), lambda c: c.id, [ 886298 ] )
def testCreateIssueComment( self ):
comment = self.pull.create_issue_comment( "Issue comment created by PyGithub" )
self.assertEqual( comment.id, 8387331 )
def testGetIssueComments( self ):
self.assertListKeyEqual( self.pull.get_issue_comments(), lambda c: c.id, [ 8387331 ] )
def testGetIssueComment( self ):
comment = self.pull.get_issue_comment( 8387331 )
self.assertEqual( comment.body, "Issue comment created by PyGithub" )
def testEditWithoutArguments( self ):
self.pull.edit()
def testEditWithAllArguments( self ):
self.pull.edit( "Title edited by PyGithub", "Body edited by PyGithub", "open" )
self.assertEqual( self.pull.title, "Title edited by PyGithub" )
self.assertEqual( self.pull.body, "Body edited by PyGithub" )
self.assertEqual( self.pull.state, "open" )
def testGetCommits( self ):
self.assertListKeyEqual( self.pull.get_commits(), lambda c: c.sha, [ "4aadfff21cdd2d2566b0e4bd7309c233b5f4ae23", "93dcae5cf207de376c91d0599226e7c7563e1d16", "8a4f306d4b223682dd19410d4a9150636ebe4206" ] )
def testGetFiles( self ):
self.assertListKeyEqual( self.pull.get_files(), lambda f: f.filename, [ "codegen/templates/GithubObject.py", "src/github/AuthenticatedUser.py", "src/github/Authorization.py", "src/github/Branch.py", "src/github/Commit.py", "src/github/CommitComment.py", "src/github/CommitFile.py", "src/github/CommitStats.py", "src/github/Download.py", "src/github/Event.py", "src/github/Gist.py", "src/github/GistComment.py", "src/github/GistHistoryState.py", "src/github/GitAuthor.py", "src/github/GitBlob.py", "src/github/GitCommit.py", "src/github/GitObject.py", "src/github/GitRef.py", "src/github/GitTag.py", "src/github/GitTree.py", "src/github/GitTreeElement.py", "src/github/Hook.py", "src/github/Issue.py", "src/github/IssueComment.py", "src/github/IssueEvent.py", "src/github/Label.py", "src/github/Milestone.py", "src/github/NamedUser.py", "src/github/Organization.py", "src/github/Permissions.py", "src/github/Plan.py", "src/github/PullRequest.py", "src/github/PullRequestComment.py", "src/github/PullRequestFile.py", "src/github/Repository.py", "src/github/RepositoryKey.py", "src/github/Tag.py", "src/github/Team.py", "src/github/UserKey.py", "test/Issue.py", "test/IssueEvent.py", "test/ReplayData/Issue.testAddAndRemoveLabels.txt", "test/ReplayData/Issue.testDeleteAndSetLabels.txt", "test/ReplayData/Issue.testGetLabels.txt", "test/ReplayData/IssueEvent.setUp.txt" ] )
def testMerge( self ):
self.assertFalse( self.pull.is_merged() )
status = self.pull.merge()
self.assertEqual( status.sha, "688208b1a5a074871d0e9376119556897439697d" )
self.assertEqual( status.merged, True )
self.assertEqual( status.message, "Pull Request successfully merged" )
self.assertTrue( self.pull.is_merged() )
def testMergeWithCommitMessage( self ):
self.g.get_user().get_repo( "PyGithub" ).get_pull( 39 ).merge( "Custom commit message created by PyGithub" )
+41
View File
@@ -0,0 +1,41 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
import datetime
class PullRequestComment( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.comment = self.g.get_user().get_repo( "PyGithub" ).get_pull( 31 ).get_comment( 886298 )
def testAttributes( self ):
self.assertEqual( self.comment.body, "Comment created by PyGithub" )
self.assertEqual( self.comment.commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" )
self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) )
self.assertEqual( self.comment.id, 886298 )
self.assertEqual( self.comment.original_commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" )
self.assertEqual( self.comment.original_position, 5 )
self.assertEqual( self.comment.path, "src/github/Issue.py" )
self.assertEqual( self.comment.position, 5 )
self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) )
self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298" )
self.assertEqual( self.comment.user.login, "jacquev6" )
def testEdit( self ):
self.comment.edit( "Comment edited by PyGithub" )
self.assertEqual( self.comment.body, "Comment edited by PyGithub" )
def testDelete( self ): # Test PullRequest.get_comments before
self.comment.delete()
+30
View File
@@ -0,0 +1,30 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class PullRequestFile( Framework.TestCase ):
def setUp( self ):
Framework.TestCase.setUp( self )
self.file = self.g.get_user().get_repo( "PyGithub" ).get_pull( 31 ).get_files()[ 0 ]
def testAttributes( self ):
self.assertEqual( self.file.additions, 1 )
self.assertEqual( self.file.blob_url, "https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py" )
self.assertEqual( self.file.changes, 2 )
self.assertEqual( self.file.deletions, 1 )
self.assertEqual( self.file.filename, "codegen/templates/GithubObject.py" )
self.assertEqual( self.file.patch, '@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:"name" %}\n- if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:\n+ if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == "scalar" %}\n {% if attribute.type.simple %}' )
self.assertEqual( self.file.raw_url, "https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py" )
self.assertEqual( self.file.sha, "8a4f306d4b223682dd19410d4a9150636ebe4206" )
self.assertEqual( self.file.status, "modified" )
+20
View File
@@ -0,0 +1,20 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import Framework
class RateLimiting( Framework.TestCase ):
def testRateLimiting( self ):
self.assertEqual( self.g.rate_limiting, ( 5000, 5000 ) )
self.g.get_user( "jacquev6" )
self.assertEqual( self.g.rate_limiting, ( 4999, 5000 ) )
@@ -0,0 +1,5 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"79f748546e5fc4492505a70de6542183"'), ('date', 'Tue, 08 May 2012 09:51:20 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"public_repos":10,"type":"User","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","followers":13,"bio":"","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","disk_usage":16692,"plan":{"private_repos":5,"space":614400,"name":"micro","collaborators":1},"html_url":"https://github.com/jacquev6","blog":"http://vincent-jacques.net","login":"jacquev6","email":"vincent@vincent-jacques.net","created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","total_private_repos":5,"public_gists":1,"following":24,"name":"Vincent Jacques","id":327146,"owned_private_repos":5,"private_gists":5,"collaborators":0,"hireable":false}
@@ -0,0 +1,5 @@
https POST api.github.com None /authorizations {'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "scopes": ["repo"], "note_url": "http://vincent-jacques.net/PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4991'), ('content-length', '382'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"41f3600b4ddb741cd59a00a88321af92"'), ('date', 'Tue, 22 May 2012 18:27:36 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/authorizations/372294')]
{"scopes":["repo"],"updated_at":"2012-05-22T18:27:36Z","app":{"url":"http://vincent-jacques.net/PyGithub","name":"Note created by PyGithub (API)"},"url":"https://api.github.com/authorizations/372294","token":"b7fd2a0346d9d590b1fad5e10971e8d29637a4ce","note":"Note created by PyGithub","note_url":"http://vincent-jacques.net/PyGithub","created_at":"2012-05-22T18:27:36Z","id":372294}
@@ -0,0 +1,5 @@
https POST api.github.com None /authorizations {'Authorization': 'Basic login_and_password_removed'} {}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4987'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4a48781fcd24441dade6248aab748487"'), ('date', 'Tue, 22 May 2012 18:03:17 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/authorizations/372259')]
{"scopes":[],"updated_at":"2012-05-22T18:03:17Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","note_url":null,"id":372259}
@@ -0,0 +1,15 @@
https GET api.github.com None /users/nvie {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4960'), ('content-length', '598'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"75740284d989e9a492e32f435cff48ac"'), ('date', 'Sat, 26 May 2012 20:23:33 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","public_gists":19,"url":"https://api.github.com/users/nvie","hireable":false,"bio":null,"company":"3rd Cloud","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","login":"nvie","blog":"http://nvie.com","email":"vincent@3rdcloud.com","public_repos":62,"followers":299,"name":"Vincent Driessen","created_at":"2009-05-12T21:19:38Z","location":"Netherlands","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":83844,"following":41,"html_url":"https://github.com/nvie"}
https GET api.github.com None /repos/nvie/gitflow {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4959'), ('content-length', '1182'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b96ea8f5f6ac24b533e2a5dc5ea2479d"'), ('date', 'Sat, 26 May 2012 20:23:34 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","full_name":"nvie/gitflow","has_wiki":true,"has_issues":true,"updated_at":"2012-05-26T19:46:41Z","forks":330,"mirror_url":null,"homepage":"http://nvie.com/posts/a-successful-git-branching-model/","ssh_url":"git@github.com:nvie/gitflow.git","open_issues":92,"fork":false,"svn_url":"https://github.com/nvie/gitflow","pushed_at":"2012-02-14T13:11:04Z","size":4602,"html_url":"https://github.com/nvie/gitflow","private":false,"url":"https://api.github.com/repos/nvie/gitflow","clone_url":"https://github.com/nvie/gitflow.git","owner":{"gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/nvie","login":"nvie","id":83844},"name":"gitflow","has_downloads":true,"language":"Shell","watchers":3973,"git_url":"git://github.com/nvie/gitflow.git","id":481366,"permissions":{"admin":false,"pull":true,"push":false},"master_branch":"develop","created_at":"2010-01-20T23:14:12Z"}
https POST api.github.com None /repos/nvie/gitflow/forks {'Authorization': 'Basic login_and_password_removed'} null
202
[('status', '202 Accepted'), ('x-ratelimit-remaining', '4958'), ('content-length', '3486'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"92f5b171559bccda47d7ebb598ba4f73"'), ('date', 'Sat, 26 May 2012 20:23:35 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"parent":{"clone_url":"https://github.com/nvie/gitflow.git","has_downloads":true,"watchers":3973,"updated_at":"2012-05-26T20:23:35Z","master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/nvie/gitflow","has_wiki":true,"has_issues":true,"fork":false,"forks":331,"size":4602,"private":false,"open_issues":92,"svn_url":"https://github.com/nvie/gitflow","owner":{"url":"https://api.github.com/users/nvie","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","login":"nvie","id":83844},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:nvie/gitflow.git","git_url":"git://github.com/nvie/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2010-01-20T23:14:12Z","id":481366,"mirror_url":null,"html_url":"https://github.com/nvie/gitflow","full_name":"nvie/gitflow"},"clone_url":"https://github.com/jacquev6/gitflow.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-26T20:23:35Z","source":{"clone_url":"https://github.com/nvie/gitflow.git","has_downloads":true,"watchers":3973,"updated_at":"2012-05-26T20:23:35Z","master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/nvie/gitflow","has_wiki":true,"has_issues":true,"fork":false,"forks":331,"size":4602,"private":false,"open_issues":92,"svn_url":"https://github.com/nvie/gitflow","owner":{"url":"https://api.github.com/users/nvie","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","login":"nvie","id":83844},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:nvie/gitflow.git","git_url":"git://github.com/nvie/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2010-01-20T23:14:12Z","id":481366,"mirror_url":null,"html_url":"https://github.com/nvie/gitflow","full_name":"nvie/gitflow"},"permissions":{"pull":true,"admin":true,"push":true},"master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/jacquev6/gitflow","has_wiki":true,"has_issues":false,"fork":true,"forks":0,"size":4602,"private":false,"open_issues":0,"svn_url":"https://github.com/jacquev6/gitflow","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:jacquev6/gitflow.git","git_url":"git://github.com/jacquev6/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2012-05-26T20:23:35Z","id":4457584,"mirror_url":null,"html_url":"https://github.com/jacquev6/gitflow","full_name":"jacquev6/gitflow"}
@@ -0,0 +1,5 @@
https POST api.github.com None /gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4967'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4099af9b70c91fb9c1c8dc72bf773c33"'), ('date', 'Sat, 19 May 2012 07:00:58 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2729810')]
{"updated_at":"2012-05-19T07:00:58Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","git_push_url":"git@gist.github.com:2729810.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}}]}
@@ -0,0 +1,5 @@
https POST api.github.com None /gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4981'), ('content-length', '1424'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7abbb6858d17ad64e3d5874676725694"'), ('date', 'Sat, 26 May 2012 09:50:03 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2793179')]
{"updated_at":"2012-05-26T09:50:02Z","url":"https://api.github.com/gists/2793179","comments":0,"public":true,"forks":[],"git_pull_url":"git://gist.github.com/2793179.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793179/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"description":null,"created_at":"2012-05-26T09:50:02Z","git_push_url":"git@gist.github.com:2793179.git","id":"2793179","history":[{"url":"https://api.github.com/gists/2793179/069e7c0041c34619b5aebf0e918536cb3bfeff9a","change_status":{"deletions":0,"additions":1,"total":1},"version":"069e7c0041c34619b5aebf0e918536cb3bfeff9a","committed_at":"2012-05-26T09:50:03Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}}],"html_url":"https://gist.github.com/2793179"}
@@ -0,0 +1,5 @@
https POST api.github.com None /user/keys {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE", "title": "Key added through PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4984'), ('content-length', '505'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7261ec55c886d6bf42e48d5bf9544586"'), ('date', 'Sat, 26 May 2012 19:49:30 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/user/keys/2626650')]
{"url":"https://api.github.com/user/keys/2626650","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==","verified":true,"title":"Key added through PyGithub","id":2626650}
@@ -0,0 +1,5 @@
https POST api.github.com None /user/repos {'Authorization': 'Basic login_and_password_removed'} {"name": "TestPyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4996'), ('content-length', '1035'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0dee1203022ede8b8374b387ba479ffd"'), ('date', 'Thu, 10 May 2012 19:17:12 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/TestPyGithub')]
{"mirror_url":null,"homepage":null,"clone_url":"https://github.com/jacquev6/TestPyGithub.git","html_url":"https://github.com/jacquev6/TestPyGithub","url":"https://api.github.com/repos/jacquev6/TestPyGithub","has_downloads":true,"watchers":1,"git_url":"git://github.com/jacquev6/TestPyGithub.git","permissions":{"admin":true,"pull":true,"push":true},"has_wiki":true,"has_issues":true,"fork":false,"forks":1,"language":null,"size":0,"description":null,"private":false,"created_at":"2012-05-10T19:17:12Z","open_issues":0,"svn_url":"https://github.com/jacquev6/TestPyGithub","owner":{"url":"https://api.github.com/users/jacquev6","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"name":"TestPyGithub","pushed_at":"2012-05-10T19:17:12Z","id":4288693,"ssh_url":"git@github.com:jacquev6/TestPyGithub.git","updated_at":"2012-05-10T19:17:12Z"}
@@ -0,0 +1,5 @@
https POST api.github.com None /user/repos {'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "TestPyGithub", "has_downloads": false, "private": false, "has_issues": false, "homepage": "http://foobar.com", "description": "Repo created by PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4979'), ('content-length', '1111'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1c6473a60481c33b28a926041f763fce"'), ('date', 'Sat, 26 May 2012 09:55:27 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/TestPyGithub')]
{"clone_url":"https://github.com/jacquev6/TestPyGithub.git","has_downloads":false,"watchers":1,"git_url":"git://github.com/jacquev6/TestPyGithub.git","updated_at":"2012-05-26T09:55:27Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://foobar.com","url":"https://api.github.com/repos/jacquev6/TestPyGithub","has_wiki":false,"has_issues":false,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/jacquev6/TestPyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"TestPyGithub","language":null,"description":"Repo created by PyGithub","ssh_url":"git@github.com:jacquev6/TestPyGithub.git","pushed_at":"2012-05-26T09:55:27Z","created_at":"2012-05-26T09:55:27Z","id":4454027,"html_url":"https://github.com/jacquev6/TestPyGithub","full_name":"jacquev6/TestPyGithub"}
@@ -0,0 +1,4 @@
https PATCH api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} {"bio": "Bio edited by PyGithub", "name": "Name edited by PyGithub", "company": "Company edited by PyGithub", "blog": "Blog edited by PyGithub", "location": "Location edited by PyGithub", "hireable": true, "email": "Email edited by PyGithub"}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '858'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4695e7d2dc3084a322fe83f342448a79"'), ('date', 'Tue, 08 May 2012 10:04:55 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"private_gists":5,"type":"User","hireable":true,"following":24,"company":"Company edited by PyGithub","blog":"Blog edited by PyGithub","bio":"Bio edited by PyGithub","html_url":"https://github.com/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","total_private_repos":5,"public_repos":10,"url":"https://api.github.com/users/jacquev6","owned_private_repos":5,"login":"jacquev6","collaborators":0,"email":"Email edited by PyGithub","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","disk_usage":16692,"plan":{"private_repos":5,"collaborators":1,"space":614400,"name":"micro"},"created_at":"2010-07-09T06:10:06Z","name":"Name edited by PyGithub","public_gists":1,"followers":13,"id":327146,"location":"Location edited by PyGithub"}
@@ -0,0 +1,5 @@
https PATCH api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} {}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"811fb4d5df8bae5b1ef7d63537891a1c"'), ('date', 'Tue, 08 May 2012 10:05:35 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"private_gists":5,"collaborators":0,"type":"User","bio":"","url":"https://api.github.com/users/jacquev6","public_repos":10,"followers":13,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","total_private_repos":5,"disk_usage":16692,"plan":{"collaborators":1,"space":614400,"name":"micro","private_repos":5},"html_url":"https://github.com/jacquev6","owned_private_repos":5,"login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","following":24,"name":"Vincent Jacques","public_gists":1,"hireable":false,"id":327146}
@@ -0,0 +1,25 @@
https GET api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4934'), ('content-length', '64'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ea6dacf29569317ccf460b4bb07075e5"'), ('date', 'Sun, 20 May 2012 12:41:39 GMT'), ('content-type', 'application/json; charset=utf-8')]
["vincent@vincent-jacques.net","github.com@vincent-jacques.net"]
https POST api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"]
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4933'), ('content-length', '94'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:40 GMT'), ('content-type', 'application/json; charset=utf-8')]
["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"]
https GET api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '94'), ('x-ratelimit-remaining', '4932'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT'), ('content-type', 'application/json; charset=utf-8')]
["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"]
https DELETE api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"]
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4931'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT')]
https GET api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4930'), ('content-length', '64'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ea6dacf29569317ccf460b4bb07075e5"'), ('date', 'Sun, 20 May 2012 12:41:42 GMT'), ('content-type', 'application/json; charset=utf-8')]
["vincent@vincent-jacques.net","github.com@vincent-jacques.net"]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /authorizations {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '384'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f6052ad2b9941ba0829e326bd76377a3"'), ('date', 'Tue, 22 May 2012 18:31:38 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"scopes":["repo"],"updated_at":"2012-05-22T18:27:36Z","app":{"url":"http://vincent-jacques.net/PyGithub","name":"Note created by PyGithub (API)"},"url":"https://api.github.com/authorizations/372294","token":"b7fd2a0346d9d590b1fad5e10971e8d29637a4ce","note_url":"http://vincent-jacques.net/PyGithub","note":"Note created by PyGithub","created_at":"2012-05-22T18:27:36Z","id":372294}]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /gists {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4966'), ('content-length', '4507'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"868b9c31808f738e0f03284a2e538a41"'), ('date', 'Sat, 26 May 2012 20:14:40 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"updated_at":"2012-05-26T11:08:22Z","url":"https://api.github.com/gists/2793505","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2793505.git","git_push_url":"git@gist.github.com:2793505.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793505/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":null,"created_at":"2012-05-26T11:08:22Z","id":"2793505","html_url":"https://gist.github.com/2793505"},{"updated_at":"2012-05-26T10:09:33Z","url":"https://api.github.com/gists/2793179","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2793179.git","git_push_url":"git@gist.github.com:2793179.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793179/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-26T09:50:02Z","id":"2793179","html_url":"https://gist.github.com/2793179"},{"updated_at":"2012-04-26T13:20:53Z","url":"https://api.github.com/gists/11cb445f8197e17d303d","comments":0,"public":false,"git_pull_url":"git://gist.github.com/11cb445f8197e17d303d.git","git_push_url":"git@gist.github.com:11cb445f8197e17d303d.git","files":{"FairThreadPoolPool.cpp":{"type":"text/plain","raw_url":"https://gist.github.com/raw/11cb445f8197e17d303d/0f72c6fe50eb011eacb4e39fa613bdfe2f7a0c51/FairThreadPoolPool.cpp","size":7779,"filename":"FairThreadPoolPool.cpp","language":"C++"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"FairThreadPoolPool.cpp","created_at":"2012-04-26T13:20:53Z","id":"11cb445f8197e17d303d","html_url":"https://gist.github.com/11cb445f8197e17d303d"},{"updated_at":"2012-02-29T16:47:12Z","url":"https://api.github.com/gists/1942384","comments":0,"public":true,"git_pull_url":"git://gist.github.com/1942384.git","git_push_url":"git@gist.github.com:1942384.git","files":{"fail_github.py":{"type":"application/python","raw_url":"https://gist.github.com/raw/1942384/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","size":1636,"filename":"fail_github.py","language":"Python"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","id":"1942384","html_url":"https://gist.github.com/1942384"},{"updated_at":"2012-02-28T19:44:42Z","url":"https://api.github.com/gists/dcb7de17e8a52b74541d","comments":1,"public":false,"git_pull_url":"git://gist.github.com/dcb7de17e8a52b74541d.git","git_push_url":"git@gist.github.com:dcb7de17e8a52b74541d.git","files":{"cadfael.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/dcb7de17e8a52b74541d/48ca696645682d7430d73180814434e0284796b2/cadfael.txt","size":585,"filename":"cadfael.txt","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Cadfael: order of episodes in French DVD edition","created_at":"2012-02-28T19:44:42Z","id":"dcb7de17e8a52b74541d","html_url":"https://gist.github.com/dcb7de17e8a52b74541d"}]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /user/keys {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4963'), ('content-length', '1968'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"753b62ed1eedc0d39ebd312719104dd1"'), ('date', 'Sat, 26 May 2012 20:18:14 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/user/keys/688586","key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC262QAZ3rvJ7KySFEHUQYGfntylusL03x/ULKdVaSltc3Z2xvWm4zQSLHrWrdUbRN9z9kMpHWZZ2G+pvUPcY/qijbqtwg9FwBHNZoviq65LujKyQeegFXQKhGGaesDeKKC+jTXbg2NJY6+u5HLe4Je8q45VVHyAfltcuSE2QoCim50toyGUGWhcIDz/2mQYpy1wtkehQA6TeC55UE00TSU06E9glnqVi8hjDlsA7DABqyctG/sjP79OwUMBppiXYX2B0RJMtRHZ+5chsHx8oqavux1oG/tdTw9ZSAfKUHfDrN97x9PB38F3j8s60S2udRwLEYuErlF1JizTF4XOZhD","verified":true,"title":"vincent@home","id":688586},{"url":"https://api.github.com/user/keys/688598","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3CG7CI2EKMS6xeHgj1lC9tkjDJRotG9ZB7E/YbMy0l15I+ReiM5cQvYhivK2myJh7uiMBPa/VjowhZb7DvitZF8aUa99zHCygKDvN/XBl2nMEY8A01BmG6/JGlP1fgU1HdbULn1E6j0a+mYIFlpDzOFKTJqR25OzngOFC4VYiPVnoyH+uPZWWeOMPgdiJxAEWKs267OjXeikYfYE2xQN9M3a1EHitkwWOeVNKIqDTxoAU8f+Ifl4Cchq4mF56pWETSsj4hQ9YhXtzI8Grun0ZoYZM/cLPLo5rSi++FAJNU2T9yc/0G75DKEYH9UroLSQBua7KF+ixrIEtD6hI4gxDQ==","verified":true,"title":"vincent@gandi","id":688598},{"url":"https://api.github.com/user/keys/2403448","key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDK+jbASXi+PhE7GpBuKEH0qC+02J8L20A9CscleT5GUXKpZSbvxmsU0XLz95kYIBVUfrmTdn3PBn6FMK2OTWpxF9gt9DKclidkv2xfA1RkqnNVpMvZbzBMDmJcWo/lae+arQVJ26O1pbZjPH56c0cYvhblsoZnI1kCFatiJ3MOUeD2zCDylsfQ8zgLKA5yj0HRC3n5cPe9nIVWXnJQ1two4GHmxE7zue+hikYB7PQvaldGKTmHX04ODyZpyFOd86cvjiftN3G39POr2vh52jBwj4oLAiF89SC3QxQes8+zF00jOmnFUlONup0nLvJg4t/ij0M2kr5cqca7pMP+QfZp","verified":true,"title":"vincent@aws","id":2403448},{"url":"https://api.github.com/user/keys/2427679","key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNQS4cnMOsGKJXBZ7DQ+6dzAHXwNYjw9W5aoonjr4pK7C9xvRPqA7QyQHub8fiYD6uj7OM8FLQgoMH1ewQULuQdH1JPkzjxPw5UpFn8eQaKOVlBkfGCiNaUOTejt5gxMrNZfPJmh2PnhsU+WXAyNNARor8CDnAmdgzHmaKKtMnRpVUJeIqKmgXhjx9lON5dZFyQGY9KIiR5gA/GWE9dFRHULoc+0gLEAR7AJ3emh55x4pqsURJpc2cdZ/X213l4Qk7HP2s7QIcihlbuxDJG9UTwjWlcIwjlQzarzhiRSyH9F3YmlT3THAdtDYX9imiBpEP52CPYNfDGrzzhbUqYj3r","verified":true,"title":"vincent@macbook","id":2427679}]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /user/orgs {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4962'), ('content-length', '262'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1534f44ae64c7b70fb520ea37de4328d"'), ('date', 'Sat, 26 May 2012 20:18:49 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/orgs/BeaverSoftware","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"}]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /gists/starred {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4965'), ('content-length', '1871'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6fe6eaa71614e18ab69868eb20639534"'), ('date', 'Sat, 26 May 2012 20:15:28 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"git_push_url":"git@gist.github.com:1942384.git","updated_at":"2012-02-29T16:47:12Z","url":"https://api.github.com/gists/1942384","comments":0,"public":true,"files":{"fail_github.py":{"type":"application/python","size":1636,"raw_url":"https://gist.github.com/raw/1942384/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","filename":"fail_github.py","language":"Python"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","git_pull_url":"git://gist.github.com/1942384.git","id":"1942384","html_url":"https://gist.github.com/1942384"},{"git_push_url":"git@gist.github.com:dcb7de17e8a52b74541d.git","updated_at":"2012-02-28T19:44:42Z","url":"https://api.github.com/gists/dcb7de17e8a52b74541d","comments":1,"public":false,"files":{"cadfael.txt":{"type":"text/plain","size":585,"raw_url":"https://gist.github.com/raw/dcb7de17e8a52b74541d/48ca696645682d7430d73180814434e0284796b2/cadfael.txt","filename":"cadfael.txt","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Cadfael: order of episodes in French DVD edition","created_at":"2012-02-28T19:44:42Z","git_pull_url":"git://gist.github.com/dcb7de17e8a52b74541d.git","id":"dcb7de17e8a52b74541d","html_url":"https://gist.github.com/dcb7de17e8a52b74541d"}]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /users/jacquev6 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f1a68180387d296f308d6a01917e1799"'), ('date', 'Sat, 26 May 2012 09:34:28 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","disk_usage":16852,"public_repos":11,"url":"https://api.github.com/users/jacquev6","hireable":false,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"public_gists":1,"bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","private_gists":5,"collaborators":0,"company":"Criteo","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","total_private_repos":5,"blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","followers":13,"name":"Vincent Jacques","owned_private_repos":5,"created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24,"html_url":"https://github.com/jacquev6"}
@@ -0,0 +1,5 @@
https GET api.github.com None /users/jacquev6 {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '623'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b81320548394cb55b7e97fb1636d2898"'), ('date', 'Sat, 26 May 2012 09:34:28 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","public_repos":11,"url":"https://api.github.com/users/jacquev6","hireable":false,"public_gists":1,"bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","company":"Criteo","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","followers":13,"name":"Vincent Jacques","created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24,"html_url":"https://github.com/jacquev6"}
@@ -0,0 +1,5 @@
https GET api.github.com None /users/jacquev6 {'Authorization': 'token private_token_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '623'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0e3990a84c08ccd728a27dbe549d4f86"'), ('date', 'Sat, 26 May 2012 09:34:29 GMT'), ('x-oauth-scopes', ''), ('content-type', 'application/json; charset=utf-8'), ('x-accepted-oauth-scopes', 'user')]
{"type":"User","company":"Criteo","location":"Paris, France","hireable":false,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","bio":"","following":24,"blog":"http://vincent-jacques.net","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","followers":13,"html_url":"https://github.com/jacquev6","url":"https://api.github.com/users/jacquev6","name":"Vincent Jacques","login":"jacquev6","public_repos":11,"public_gists":1,"email":"vincent@vincent-jacques.net","id":327146,"created_at":"2010-07-09T06:10:06Z"}
@@ -0,0 +1,5 @@
https GET api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e15ef91b6fe4705f493fca75475b763b"'), ('date', 'Tue, 22 May 2012 18:03:49 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"scopes":[],"note_url":null,"updated_at":"2012-05-22T18:03:17Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259}
@@ -0,0 +1,5 @@
https DELETE api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} null
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4992'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Tue, 22 May 2012 18:25:53 GMT')]
@@ -0,0 +1,25 @@
https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"39fec03a7cbd97abde96cccbd1921277"'), ('date', 'Tue, 22 May 2012 18:24:09 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"scopes":[],"updated_at":"2012-05-22T18:24:09Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259}
https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"scopes": ["user"]}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('content-length', '334'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6476c8dce7e66cb43e71317294fd5b42"'), ('date', 'Tue, 22 May 2012 18:24:09 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"scopes":["user"],"updated_at":"2012-05-22T18:24:09Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259}
https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"add_scopes": ["repo"]}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '341'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"aef23fb8f728fcd7acf751015c21661a"'), ('date', 'Tue, 22 May 2012 18:24:10 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"scopes":["user","repo"],"updated_at":"2012-05-22T18:24:10Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"note_url":null,"created_at":"2012-05-22T18:03:17Z","id":372259}
https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"remove_scopes": ["repo"]}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '334'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"dff7e491f5d3c779385b9f3a41694a32"'), ('date', 'Tue, 22 May 2012 18:24:11 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"scopes":["user"],"updated_at":"2012-05-22T18:24:11Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259}
https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "note_url": "http://vincent-jacques.net/PyGithub"}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '382'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"5881b7d6eaa13e3b8539ca6ffc334be1"'), ('date', 'Tue, 22 May 2012 18:24:11 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"note_url":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/authorizations/372259","app":{"url":"http://vincent-jacques.net/PyGithub","name":"Note created by PyGithub (API)"},"scopes":["user"],"note":"Note created by PyGithub","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","created_at":"2012-05-22T18:03:17Z","updated_at":"2012-05-22T18:24:11Z","id":372259}
+15
View File
@@ -0,0 +1,15 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4967'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"27524c635501121933f4f78c95b1945a"'), ('date', 'Fri, 18 May 2012 20:12:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"owned_private_repos":5,"collaborators":0,"type":"User","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","public_gists":1,"company":"Criteo","bio":"","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","private_gists":5,"plan":{"collaborators":1,"private_repos":5,"name":"micro","space":614400},"public_repos":11,"followers":13,"login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","disk_usage":16852,"html_url":"https://github.com/jacquev6","name":"Vincent Jacques","total_private_repos":5,"created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24}
https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4966'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c5eec74d4b76b80283636a8efe1a132c"'), ('date', 'Fri, 18 May 2012 20:12:20 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"svn_url":"https://github.com/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"updated_at":"2012-05-18T05:29:54Z","forks":2,"homepage":"http://vincent-jacques.net/PyGithub","git_url":"git://github.com/jacquev6/PyGithub.git","url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","open_issues":17,"fork":false,"ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-18T05:18:16Z","size":304,"private":false,"has_downloads":true,"watchers":13,"html_url":"https://github.com/jacquev6/PyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","permissions":{"pull":true,"admin":true,"push":true},"mirror_url":null,"language":"Python","description":"Python library implementing the full Github API v3","created_at":"2012-02-25T12:53:47Z","id":3544490}
https GET api.github.com None /repos/jacquev6/PyGithub/branches {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '769'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2dada6dafd332016bcdf06e42487e520"'), ('date', 'Thu, 10 May 2012 13:56:55 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"name":"topic/RewriteWithGeneratedCode","commit":{"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a"}},{"name":"master","commit":{"sha":"4303c5b90e2216d927155e9609436ccb8984c495","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/4303c5b90e2216d927155e9609436ccb8984c495"}},{"name":"topic/DependencyGraph","commit":{"sha":"05157f11f29a3ac057e35d2487880c5d08bd69af","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/05157f11f29a3ac057e35d2487880c5d08bd69af"}},{"name":"develop","commit":{"sha":"4303c5b90e2216d927155e9609436ccb8984c495","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/4303c5b90e2216d927155e9609436ccb8984c495"}}]
File diff suppressed because one or more lines are too long
+15
View File
@@ -0,0 +1,15 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4976'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"eb9e14862baa71c04b8f0e73ab870756"'), ('date', 'Sun, 27 May 2012 06:50:51 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"public_gists":3,"type":"User","disk_usage":16976,"private_gists":5,"public_repos":11,"url":"https://api.github.com/users/jacquev6","total_private_repos":5,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"blog":"http://vincent-jacques.net","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","owned_private_repos":5,"collaborators":0,"company":"Criteo","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","email":"vincent@vincent-jacques.net","hireable":false,"followers":13,"name":"Vincent Jacques","created_at":"2010-07-09T06:10:06Z","location":"Paris, France","bio":"","id":327146,"following":24,"html_url":"https://github.com/jacquev6"}
https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4975'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2f4d8b003c5c4f390be2ac28fe623bdb"'), ('date', 'Sun, 27 May 2012 06:50:52 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"git_url":"git://github.com/jacquev6/PyGithub.git","updated_at":"2012-05-27T06:00:29Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"fork":false,"forks":3,"mirror_url":null,"size":308,"private":false,"open_issues":16,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T06:00:28Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"}
https GET api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '3445'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bcfd8d733465b9c28525edfc78ede564"'), ('date', 'Sun, 27 May 2012 06:50:52 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"parents":[{"sha":"b46ed0dfde5ad02d3b91eb54a41c5ed960710eae","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/b46ed0dfde5ad02d3b91eb54a41c5ed960710eae"}],"commit":{"message":"Remove completion functions from GitAuthor","author":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"committer":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"tree":{"sha":"4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a"},"author":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"committer":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","stats":{"total":20,"deletions":20,"additions":0},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a","files":[{"patch":"@@ -14,22 +14,17 @@ def __init__( self, requester, attributes, lazy ):\n self.__completed = False\n self.__initAttributes()\n self.__useAttributes( attributes )\n- if not lazy:\n- self.__complete()\n \n @property\n def date( self ):\n- self.__completeIfNeeded( self.__date )\n return self.__date\n \n @property\n def email( self ):\n- self.__completeIfNeeded( self.__email )\n return self.__email\n \n @property\n def name( self ):\n- self.__completeIfNeeded( self.__name )\n return self.__name\n \n def __initAttributes( self ):\n@@ -37,21 +32,6 @@ def __initAttributes( self ):\n self.__email = None\n self.__name = None\n \n- def __completeIfNeeded( self, testedAttribute ):\n- if not self.__completed and testedAttribute is None:\n- self.__complete()\n-\n- # @toto Do not generate __complete if type has no url attribute\n- def __complete( self ):\n- status, headers, data = self.__requester.request(\n- \"GET\",\n- self.__url,\n- None,\n- None\n- )\n- self.__useAttributes( data )\n- self.__completed = True\n-\n def __useAttributes( self, attributes ):\n #@toto No need to check if attribute is in attributes when attribute is mandatory\n if \"date\" in attributes and attributes[ \"date\" ] is not None:","status":"modified","deletions":20,"blob_url":"https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","changes":20,"additions":0,"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","raw_url":"https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","filename":"github/GithubObjects/GitAuthor.py"}]}
@@ -0,0 +1,5 @@
https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4982'), ('content-length', '714'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bd72e3550c9b90814f0be2b54ab2cc8e"'), ('date', 'Tue, 22 May 2012 18:40:18 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1361949')]
{"updated_at":"2012-05-22T18:40:18Z","position":null,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1361949","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","created_at":"2012-05-22T18:40:18Z","path":null,"line":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1361949,"html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1361949"}
@@ -0,0 +1,5 @@
https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "line": 26}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4970'), ('content-length', '764'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d2cb361ce6c53a0fc986e74f8547088f"'), ('date', 'Tue, 22 May 2012 18:49:34 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1362000')]
{"updated_at":"2012-05-22T18:49:34Z","position":null,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1362000","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","created_at":"2012-05-22T18:49:34Z","path":"codegen/templates/GithubObject.MethodBody.UseResult.py","line":26,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1362000,"html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1362000"}
@@ -0,0 +1,5 @@
https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment also created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "position": 3}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4966'), ('content-length', '768'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b3d062ed01b92c31d072c7177113c0b1"'), ('date', 'Tue, 22 May 2012 18:50:02 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1362001')]
{"url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1362001","path":"codegen/templates/GithubObject.MethodBody.UseResult.py","body":"Comment also created by PyGithub","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1362001","created_at":"2012-05-22T18:50:02Z","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","position":3,"updated_at":"2012-05-22T18:50:02Z","id":1362001,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}
@@ -0,0 +1,5 @@
https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} {"state": "success", "target_url": "https://github.com/jacquev6/PyGithub/issues/67", "description": "Status successfuly created by PyGithub"}
201
[('status', '201 Created'), ('content-length', '603'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4975'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"06233b816702bedc54a6f68734a910bc"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/statuses/277040'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 11:30:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"state":"success","updated_at":"2012-09-08T11:30:56Z","target_url":"https://github.com/jacquev6/PyGithub/issues/67","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277040","description":"Status successfuly created by PyGithub","id":277040,"created_at":"2012-09-08T11:30:56Z"}
@@ -0,0 +1,5 @@
https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} {"state": "pending"}
201
[('status', '201 Created'), ('content-length', '523'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4979'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/statuses/277031'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 11:27:12 GMT'), ('etag', '"7e28427673d50844a69c0871e5e39a69"'), ('content-type', 'application/json; charset=utf-8')]
{"description":null,"created_at":"2012-09-08T11:27:12Z","target_url":null,"state":"pending","updated_at":"2012-09-08T11:27:12Z","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277031","id":277031,"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","id":327146}}
@@ -0,0 +1,5 @@
https GET api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '4322'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9000a379c4d5eba3527a002d2bbc2e0c"'), ('date', 'Fri, 18 May 2012 20:12:18 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"updated_at":"2012-05-18T08:46:09Z","position":null,"body":"probably a noob question: does this completion refer to autocompletion in IDE's/editors? \nI have observed that this is pretty erratic sometimes. I'm using PyDev+Eclipse.\nFor example, in the tutorial from the readme, `g.get_u` gets autocompleted correctly, but `g.get_user().get_r` (or any method or attribute applicable to NamedUsers/AuthenticatedUser, really) does not show autocompletion to `g.get_user().get_repo()`. Is that by design? It makes exploring the library/API a bit cumbersome. ","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1347033","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1347033","created_at":"2012-05-18T08:46:09Z","path":null,"line":null,"user":{"url":"https://api.github.com/users/bilderbuchi","gravatar_id":"2aed663a62fa8bf9f7aebe603d3998bb","avatar_url":"https://secure.gravatar.com/avatar/2aed663a62fa8bf9f7aebe603d3998bb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bilderbuchi","id":327442},"id":1347033},{"updated_at":"2012-05-18T09:03:40Z","position":null,"body":"No, it has nothing to do with auto-completion in IDEs :D\n\nGithub API v3 sends only the main part of objects in reply to some requests. So, if the user wants an attribute that has not been received yet, I have to do another request to complete the object.\n\nYet, in version 1.0 (see the milesone), my library will be much more readable for IDEs and their auto-completion mechanisms, because I am giving up the meta-description that I used until 0.6, and I'm now generating much more traditional code, that you will be able to explore as if it was written manually.\n\nIf you want to take the time to open an issue about auto-completion in IDEs, I'll deal with it in milestone 1.0.\n\nThanks !","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1347083","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1347083","created_at":"2012-05-18T08:59:28Z","path":null,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"id":1347083},{"updated_at":"2012-05-18T10:55:55Z","position":null,"body":"Ah, thanks for the clarification. :blush:\n\nI made issue #27 for the autocompletion. I already suspected something like this meta-description magic, since I tried to read some of the code and it was pretty arcane. I attributed that to my pythonic noobness, though. Thank you. ","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1347397","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1347397","created_at":"2012-05-18T10:54:23Z","path":null,"line":null,"user":{"url":"https://api.github.com/users/bilderbuchi","gravatar_id":"2aed663a62fa8bf9f7aebe603d3998bb","avatar_url":"https://secure.gravatar.com/avatar/2aed663a62fa8bf9f7aebe603d3998bb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bilderbuchi","id":327442},"id":1347397},{"updated_at":"2012-05-18T20:11:17Z","position":3,"body":"This comment is here only to test PyGithub...","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1349654","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1349654","created_at":"2012-05-18T20:11:17Z","path":"codegen/templates/GithubObject.MethodBody.UseResult.py","line":25,"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"id":1349654}]
@@ -0,0 +1,15 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4967'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"27524c635501121933f4f78c95b1945a"'), ('date', 'Fri, 18 May 2012 20:12:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"owned_private_repos":5,"collaborators":0,"type":"User","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","public_gists":1,"company":"Criteo","bio":"","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","private_gists":5,"plan":{"collaborators":1,"private_repos":5,"name":"micro","space":614400},"public_repos":11,"followers":13,"login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","disk_usage":16852,"html_url":"https://github.com/jacquev6","name":"Vincent Jacques","total_private_repos":5,"created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24}
https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4966'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c5eec74d4b76b80283636a8efe1a132c"'), ('date', 'Fri, 18 May 2012 20:12:20 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"svn_url":"https://github.com/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"updated_at":"2012-05-18T05:29:54Z","forks":2,"homepage":"http://vincent-jacques.net/PyGithub","git_url":"git://github.com/jacquev6/PyGithub.git","url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","open_issues":17,"fork":false,"ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-18T05:18:16Z","size":304,"private":false,"has_downloads":true,"watchers":13,"html_url":"https://github.com/jacquev6/PyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","permissions":{"pull":true,"admin":true,"push":true},"mirror_url":null,"language":"Python","description":"Python library implementing the full Github API v3","created_at":"2012-02-25T12:53:47Z","id":3544490}
https GET api.github.com None /repos/jacquev6/PyGithub/comments/1361949 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '714'), ('x-ratelimit-remaining', '4979'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"eebb2ebe0274fc6672c9e7bad74e5f39"'), ('date', 'Tue, 22 May 2012 18:43:13 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1361949","path":null,"body":"Comment created by PyGithub","html_url":"https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949","created_at":"2012-05-22T18:40:18Z","commit_id":"6945921c529be14c3a8f566dd1e483674516d46d","position":null,"updated_at":"2012-05-22T18:40:18Z","id":1361949,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}
@@ -0,0 +1,5 @@
https DELETE api.github.com None /repos/jacquev6/PyGithub/comments/1361949 {'Authorization': 'Basic login_and_password_removed'} null
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4974'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Tue, 22 May 2012 18:44:06 GMT')]
@@ -0,0 +1,5 @@
https PATCH api.github.com None /repos/jacquev6/PyGithub/comments/1361949 {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"}
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '713'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"97ffd9ff8370f4f284873a6397d7cafd"'), ('date', 'Tue, 22 May 2012 18:43:17 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"updated_at":"2012-05-22T18:43:17Z","position":null,"body":"Comment edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1361949","commit_id":"6945921c529be14c3a8f566dd1e483674516d46d","created_at":"2012-05-22T18:40:18Z","path":null,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1361949,"html_url":"https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949"}
@@ -0,0 +1,20 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '806'), ('server', 'nginx/1.0.13'), ('last-modified', 'Wed, 05 Sep 2012 15:03:24 GMT'), ('connection', 'keep-alive'), ('etag', '"350294b94004d4bb252b6a432baa5744"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 08 Sep 2012 11:33:18 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","email":"vincent@vincent-jacques.net","disk_usage":14680,"following":28,"location":"Paris, France","hireable":false,"bio":"","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","public_gists":3,"total_private_repos":5,"collaborators":0,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","private_gists":5,"owned_private_repos":5,"public_repos":11,"name":"Vincent Jacques","company":"Criteo","url":"https://api.github.com/users/jacquev6","login":"jacquev6","plan":{"collaborators":1,"name":"micro","private_repos":5,"space":614400},"followers":13,"html_url":"https://github.com/jacquev6","id":327146,"created_at":"2010-07-09T06:10:06Z","blog":"http://vincent-jacques.net"}
https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '1239'), ('server', 'nginx/1.0.13'), ('last-modified', 'Sat, 08 Sep 2012 11:05:28 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b5deefd5e5a20ae540958af4330940c3"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Sat, 08 Sep 2012 11:33:18 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"master_branch":"master","forks":16,"open_issues_count":14,"has_downloads":true,"owner":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"},"description":"Python library implementing the full Github API v3","permissions":{"pull":true,"push":true,"admin":true},"forks_count":16,"clone_url":"https://github.com/jacquev6/PyGithub.git","created_at":"2012-02-25T12:53:47Z","network_count":16,"has_wiki":false,"watchers":67,"mirror_url":null,"size":268,"fork":false,"open_issues":14,"has_issues":true,"git_url":"git://github.com/jacquev6/PyGithub.git","updated_at":"2012-09-08T11:05:28Z","full_name":"jacquev6/PyGithub","name":"PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","private":false,"id":3544490,"language":"Python","watchers_count":67,"homepage":"http://vincent-jacques.net/PyGithub","svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-09-08T11:05:27Z"}
https GET api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '3473'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4968'), ('server', 'nginx/1.0.13'), ('last-modified', 'Wed, 09 May 2012 16:22:33 GMT'), ('connection', 'keep-alive'), ('etag', '"65d19a8fbfb1103ea7421e4c514d75d3"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Sat, 08 Sep 2012 11:33:19 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')]
{"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","stats":{"total":20,"additions":0,"deletions":20},"files":[{"filename":"github/GithubObjects/GitAuthor.py","sha":"ca6a3c616fc1367b6d01d04a7cf6ee27cf216f26","status":"modified","raw_url":"https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","additions":0,"patch":"@@ -14,22 +14,17 @@ def __init__( self, requester, attributes, lazy ):\n self.__completed = False\n self.__initAttributes()\n self.__useAttributes( attributes )\n- if not lazy:\n- self.__complete()\n \n @property\n def date( self ):\n- self.__completeIfNeeded( self.__date )\n return self.__date\n \n @property\n def email( self ):\n- self.__completeIfNeeded( self.__email )\n return self.__email\n \n @property\n def name( self ):\n- self.__completeIfNeeded( self.__name )\n return self.__name\n \n def __initAttributes( self ):\n@@ -37,21 +32,6 @@ def __initAttributes( self ):\n self.__email = None\n self.__name = None\n \n- def __completeIfNeeded( self, testedAttribute ):\n- if not self.__completed and testedAttribute is None:\n- self.__complete()\n-\n- # @todo Do not generate __complete if type has no url attribute\n- def __complete( self ):\n- status, headers, data = self.__requester.request(\n- \"GET\",\n- self.__url,\n- None,\n- None\n- )\n- self.__useAttributes( data )\n- self.__completed = True\n-\n def __useAttributes( self, attributes ):\n #@todo No need to check if attribute is in attributes when attribute is mandatory\n if \"date\" in attributes and attributes[ \"date\" ] is not None:","blob_url":"https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","changes":20,"deletions":20}],"author":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","id":327146},"commit":{"message":"Remove completion functions from GitAuthor","author":{"email":"vincent@vincent-jacques.net","name":"Vincent Jacques","date":"2012-05-09T09:22:33-07:00"},"comment_count":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a","tree":{"sha":"4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab"},"committer":{"email":"vincent@vincent-jacques.net","name":"Vincent Jacques","date":"2012-05-09T09:22:33-07:00"}},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a","parents":[{"sha":"b46ed0dfde5ad02d3b91eb54a41c5ed960710eae","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/b46ed0dfde5ad02d3b91eb54a41c5ed960710eae"}],"committer":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","id":327146}}
https GET api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4967'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"33102158c69b28937a0b6a7031ba9c88"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 11:33:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"description":"Status successfuly created by PyGithub","created_at":"2012-09-08T11:30:56Z","target_url":"https://github.com/jacquev6/PyGithub/issues/67","state":"success","updated_at":"2012-09-08T11:30:56Z","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277040","id":277040,"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"}},{"description":null,"created_at":"2012-09-08T11:27:12Z","target_url":null,"state":"pending","updated_at":"2012-09-08T11:27:12Z","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277031","id":277031,"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"}}]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,15 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4953'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e1a1f6f825326642be4ed8e6f8427437"'), ('date', 'Tue, 22 May 2012 19:15:57 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","disk_usage":16849,"bio":"","url":"https://api.github.com/users/jacquev6","total_private_repos":5,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"owned_private_repos":5,"public_repos":11,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","public_gists":1,"company":"Criteo","login":"jacquev6","email":"vincent@vincent-jacques.net","private_gists":5,"collaborators":0,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","html_url":"https://github.com/jacquev6","created_at":"2010-07-09T06:10:06Z","blog":"http://vincent-jacques.net","location":"Paris, France","id":327146,"followers":13,"following":24,"hireable":false}
https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4952'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c26fc3fce8f52d05f1adf2025bfe34ab"'), ('date', 'Tue, 22 May 2012 19:15:58 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"pushed_at":"2012-05-21T13:48:43Z","updated_at":"2012-05-22T19:15:29Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","has_downloads":true,"watchers":13,"permissions":{"pull":true,"admin":true,"push":true},"fork":false,"svn_url":"https://github.com/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"size":181,"private":false,"forks":2,"owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","clone_url":"https://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","created_at":"2012-02-25T12:53:47Z","id":3544490,"open_issues":17,"mirror_url":null,"git_url":"git://github.com/jacquev6/PyGithub.git"}
https GET api.github.com None /repos/jacquev6/PyGithub/downloads/242550 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4960'), ('content-length', '290'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6d8a8b9509b1686543a96ec3c58b0293"'), ('date', 'Tue, 22 May 2012 19:03:36 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"content_type":"text/plain","download_count":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/downloads/242550","size":1024,"name":"Foobar.txt","created_at":"2012-05-22T18:58:32Z","description":null,"html_url":"https://github.com/downloads/jacquev6/PyGithub/Foobar.txt","id":242550}
@@ -0,0 +1,5 @@
https DELETE api.github.com None /repos/jacquev6/PyGithub/downloads/242550 {'Authorization': 'Basic login_and_password_removed'} null
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4950'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Tue, 22 May 2012 19:16:03 GMT')]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
401
[('status', '401 Unauthorized'), ('content-length', '29'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"ca6a3702f840b6bff0bb1bca6be0337c"'), ('date', 'Sat, 02 Jun 2012 12:12:32 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"message":"Bad credentials"}
@@ -0,0 +1,5 @@
https POST api.github.com None /user/keys {'Authorization': 'Basic login_and_password_removed'} {"key": "xxx", "title": "Bad key"}
422
[('status', '422 Unprocessable Entity'), ('x-ratelimit-remaining', '4995'), ('content-length', '221'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"73f756ef75655dd74463eb1bf4cfefe1"'), ('date', 'Wed, 30 May 2012 07:00:27 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"message":"Validation Failed","errors":[{"field":"key","resource":"PublicKey","message":"key is invalid. It must begin with 'ssh-rsa' or 'ssh-dss'. Check that you're copying the public half of the key","code":"custom"}]}
@@ -0,0 +1,10 @@
https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4971'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0e6c8f1cbb0c4f0eae96d8a76de9a43f"'), ('date', 'Sat, 02 Jun 2012 12:11:46 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","total_private_repos":5,"company":"Criteo","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","public_gists":3,"email":"vincent@vincent-jacques.net","owned_private_repos":5,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","private_gists":5,"collaborators":0,"created_at":"2010-07-09T06:10:06Z","blog":"http://vincent-jacques.net","location":"Paris, France","url":"https://api.github.com/users/jacquev6","following":24,"disk_usage":16988,"public_repos":10,"name":"Vincent Jacques","hireable":false,"followers":13,"html_url":"https://github.com/jacquev6","id":327146,"plan":{"private_repos":5,"collaborators":1,"space":614400,"name":"micro"},"bio":""}
https GET api.github.com None /repos/jacquev6/Xxx {'Authorization': 'Basic login_and_password_removed'} null
404
[('status', '404 Not Found'), ('x-ratelimit-remaining', '4970'), ('content-length', '23'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e66a7a6c91e2c26803f3f49feb7a883f"'), ('date', 'Sat, 02 Jun 2012 12:11:47 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"message":"Not Found"}
@@ -0,0 +1,5 @@
https GET api.github.com None /users/ThisUserShouldReallyNotExist {'Authorization': 'Basic login_and_password_removed'} null
404
[('status', '404 Not Found'), ('x-ratelimit-remaining', '4968'), ('content-length', '23'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e66a7a6c91e2c26803f3f49feb7a883f"'), ('date', 'Sat, 02 Jun 2012 12:24:43 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"message":"Not Found"}
+5
View File
@@ -0,0 +1,5 @@
https GET api.github.com None /gists/2729810 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '3280'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b01fb6ac81527f99db9f6f586b048ee3"'), ('date', 'Sat, 19 May 2012 06:58:15 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"updated_at":"2012-02-29T16:47:12Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"fail_github.py":{"type":"application/python","raw_url":"https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","size":1636,"filename":"fail_github.py","content":"import httplib\nimport base64\nimport json\n\nlogin = \"\"\npassword = \"\"\norgName = \"\"\nrepoName = \"FailGithubApi\"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( \"api.github.com\", strict = True )\n cnx.request( verb, url, input, { \"Authorization\" : \"Basic \" + base64.b64encode( login + \":\" + password ).replace( '\\n', '' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, \"=>\", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( \"POST\", \"/user/repos\", { \"name\": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( login, repoName ),\n { \"content\": \"Content of the blob\", \"encoding\": \"latin1\" }\n)\nt = doRequest(\n \"POST\", \"/repos/%s/%s/git/trees\" % ( login, repoName ),\n { \"tree\" : [ { \"path\": \"foo.bar\", \"type\": \"blob\", \"mode\": \"100644\", \"sha\": b[\"sha\"] } ] }\n)\nc = doRequest(\n \"POST\", \"/repos/%s/%s/git/commits\" % ( login, repoName ),\n { \"parents\": [], \"message\": \"Message of the commit\", \"tree\": t[\"sha\"] }\n)\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/refs\" % ( login, repoName ),\n { \"ref\": \"refs/heads/master\", \"sha\": c[\"sha\"] }\n)\n\n# Fork the repo\ndoRequest( \"POST\", \"/repos/%s/%s/forks?org=%s\" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( orgName, repoName ),\n { \"content\": \"Content of the new blob\", \"encoding\": \"latin1\" }\n)\n","language":"Python"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e","change_status":{"deletions":0,"additions":52,"total":52},"committed_at":"2012-02-29T16:47:12Z","version":"a40de483e42ba33bda308371c0ef8383db73be9e","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}]}
@@ -0,0 +1,5 @@
https POST api.github.com None /gists/2729810/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4992'), ('content-length', '479'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"77456eabf6ebaafc2808cfbd4dfa5904"'), ('date', 'Sat, 19 May 2012 07:07:57 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/comments/323629')]
{"updated_at":"2012-05-19T07:07:57Z","body":"Comment created by PyGithub","url":"https://api.github.com/gists/comments/323629","created_at":"2012-05-19T07:07:57Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"id":323629}
@@ -0,0 +1,5 @@
https DELETE api.github.com None /gists/2729810 {'Authorization': 'Basic login_and_password_removed'} null
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4965'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:26:55 GMT')]

Some files were not shown because too many files have changed in this diff Show More