Improve test coverage of NamedUser

This commit is contained in:
Vincent Jacques
2012-05-20 13:35:11 +01:00
parent beaa58ca0c
commit 6a2e4b4958
17 changed files with 229 additions and 31 deletions
@@ -395,7 +395,6 @@
},
{
"name": "Event",
"isCompletable": true,
"attributes": [
{ "name": "commit_id", "type": "@todo" },
{ "name": "created_at", "type": "@todo" },
@@ -2438,7 +2438,7 @@
"name": "url"
}
],
"isCompletable": true,
"isCompletable": false,
"name": "Event",
"methods": []
},
-29
View File
@@ -12,68 +12,53 @@ class Event( object ):
self.__requester = requester
self.__initAttributes()
self.__useAttributes( attributes )
self.__completed = completion != LazyCompletion
if completion == ImmediateCompletion:
self.__complete()
@property
def actor( self ):
self.__completeIfNeeded( self.__actor )
return self.__actor
@property
def commit_id( self ):
self.__completeIfNeeded( self.__commit_id )
return self.__commit_id
@property
def created_at( self ):
self.__completeIfNeeded( self.__created_at )
return self.__created_at
@property
def event( self ):
self.__completeIfNeeded( self.__event )
return self.__event
@property
def id( self ):
self.__completeIfNeeded( self.__id )
return self.__id
@property
def issue( self ):
self.__completeIfNeeded( self.__issue )
return self.__issue
@property
def org( self ):
self.__completeIfNeeded( self.__org )
return self.__org
@property
def payload( self ):
self.__completeIfNeeded( self.__payload )
return self.__payload
@property
def public( self ):
self.__completeIfNeeded( self.__public )
return self.__public
@property
def repo( self ):
self.__completeIfNeeded( self.__repo )
return self.__repo
@property
def type( self ):
self.__completeIfNeeded( self.__type )
return self.__type
@property
def url( self ):
self.__completeIfNeeded( self.__url )
return self.__url
def __initAttributes( self ):
@@ -90,20 +75,6 @@ class Event( object ):
self.__type = None
self.__url = None
def __completeIfNeeded( self, testedAttribute ):
if not self.__completed and testedAttribute is None:
self.__complete()
def __complete( self ):
status, headers, data = self.__requester.request(
"GET",
self.__url,
None,
None
)
self.__useAttributes( data )
self.__completed = True
def __useAttributes( self, attributes ):
# @todo Remove this debug weakness: we shall assume that github will add new attributes
for attribute in attributes:
+92
View File
@@ -59,3 +59,95 @@ class NamedUser( Framework.TestCase ):
self.assertEqual( user.total_private_repos, 5 )
self.assertEqual( user.type, "User" )
self.assertEqual( user.url, "https://api.github.com/users/jacquev6" )
def testCreateGist( self ):
gist = self.g.get_user( "jacquev6" ).create_gist( True, { "foobar.txt": { "content": "File created by PyGithub" } }, "Gist created by PyGithub on a NamedUser" )
self.assertEqual( gist.description, "Gist created by PyGithub on a NamedUser" )
gist.delete()
def testGetGists( self ):
gist = self.g.get_user( "nvie" ).get_gists()[ 0 ]
self.assertEqual( gist.description, "zsh-sourcing.txt" )
def testFollowing( self ):
user = self.g.get_user( "jacquev6" )
follower = user.get_followers()[ 0 ]
self.assertEqual( follower.login, "jnorthrup" )
followed = user.get_following()[ 0 ]
self.assertEqual( followed.login, "nvie" )
def testEvents( self ):
event = self.g.get_user( "jacquev6" ).get_events()[ 0 ]
self.assertEqual( event.actor.login, "jacquev6" )
self.assertEqual( event.commit_id, None )
self.assertEqual( event.created_at, "2012-05-20T12:14:09Z" )
self.assertEqual( event.event, None )
self.assertEqual( event.id, "1553915048" )
self.assertEqual( event.issue, None )
self.assertEqual( event.org, None )
self.assertEqual( event.payload, {u'action': u'create', u'gist': {u'files': {}, u'description': u'Gist created by PyGithub on a NamedUser', u'url': u'https://api.github.com/gists/2757859', u'created_at': u'2012-05-20T12:14:08Z', u'updated_at': u'2012-05-20T12:14:08Z', u'comments': 0, u'id': u'2757859', u'html_url': u'https://gist.github.com/2757859', u'user': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'git_pull_url': u'git://gist.github.com/2757859.git', u'git_push_url': u'git@gist.github.com:2757859.git', u'public': True}} ) ### @todo
self.assertEqual( event.public, True )
self.assertEqual( event.repo.name, "/" ) # WTF
self.assertEqual( event.type, "GistEvent" )
self.assertEqual( event.url, None )
def testOrganizations( self ):
org = self.g.get_user( "jacquev6" ).get_orgs()[ 0 ]
self.assertEqual( org.login, "BeaverSoftware" )
def testPublicEvents( self ):
event = self.g.get_user( "jacquev6" ).get_public_events()[ 0 ]
self.assertEqual( event.actor.login, "jacquev6" )
self.assertEqual( event.commit_id, None )
self.assertEqual( event.created_at, "2012-05-20T12:14:09Z" )
self.assertEqual( event.event, None )
self.assertEqual( event.id, "1553915048" )
self.assertEqual( event.issue, None )
self.assertEqual( event.org, None )
self.assertEqual( event.payload, {u'action': u'create', u'gist': {u'files': {}, u'description': u'Gist created by PyGithub on a NamedUser', u'url': u'https://api.github.com/gists/2757859', u'created_at': u'2012-05-20T12:14:08Z', u'updated_at': u'2012-05-20T12:14:08Z', u'comments': 0, u'id': u'2757859', u'html_url': u'https://gist.github.com/2757859', u'user': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'git_pull_url': u'git://gist.github.com/2757859.git', u'git_push_url': u'git@gist.github.com:2757859.git', u'public': True}} ) ### @todo
self.assertEqual( event.public, True )
self.assertEqual( event.repo.name, "/" ) # WTF
self.assertEqual( event.type, "GistEvent" )
self.assertEqual( event.url, None )
def testPublicReceivedEvents( self ):
event = self.g.get_user( "jacquev6" ).get_public_received_events()[ 0 ]
self.assertEqual( event.actor.login, "cherryboss" )
self.assertEqual( event.commit_id, None )
self.assertEqual( event.created_at, "2012-05-20T12:29:18Z" )
self.assertEqual( event.event, None )
self.assertEqual( event.id, "1553916447" )
self.assertEqual( event.issue, None )
self.assertEqual( event.org.login, "github" )
self.assertEqual( event.payload, {u'comment': {u'body': u'+1', u'url': u'https://api.github.com/repos/github/markup/issues/comments/5808535', u'created_at': u'2012-05-20T12:29:17Z', u'updated_at': u'2012-05-20T12:29:17Z', u'user': {u'url': u'https://api.github.com/users/cherryboss', u'login': u'cherryboss', u'avatar_url': u'https://secure.gravatar.com/avatar/b3cb2e7b64cad46d1cd6e5d3294c12cc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 1078894, u'gravatar_id': u'b3cb2e7b64cad46d1cd6e5d3294c12cc'}, u'id': 5808535}, u'action': u'created', u'issue': {u'body': u"Hello, I've created support for great Texy! text-to-HTML formatter and converter library (http://texy.info, http://github.com/dg/texy).\r\n\r\nHere's my implementation branch: https://github.com/smasty/markup/tree/texy", u'labels': [], u'title': u'[new markup] Texy! formatter support', u'url': u'https://api.github.com/repos/github/markup/issues/34', u'created_at': u'2011-01-21T16:04:58Z', u'milestone': None, u'number': 34, u'comments': 23, u'updated_at': u'2012-05-20T12:29:17Z', u'assignee': None, u'html_url': u'https://github.com/github/markup/issues/34', u'state': u'open', u'user': {u'url': u'https://api.github.com/users/smasty', u'login': u'smasty', u'avatar_url': u'https://secure.gravatar.com/avatar/c27f2f0deb68f04a58db7b7254df893b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 218524, u'gravatar_id': u'c27f2f0deb68f04a58db7b7254df893b'}, u'pull_request': {u'diff_url': u'https://github.com/github/markup/pull/34.diff', u'patch_url': u'https://github.com/github/markup/pull/34.patch', u'html_url': u'https://github.com/github/markup/pull/34'}, u'closed_at': None, u'id': 541804}} ) ### @todo
self.assertEqual( event.public, True )
self.assertEqual( event.repo.name, "github/markup" ) # WTF
self.assertEqual( event.type, "IssueCommentEvent" )
self.assertEqual( event.url, None )
def testReceivedEvents( self ):
event = self.g.get_user( "jacquev6" ).get_received_events()[ 0 ]
self.assertEqual( event.actor.login, "cherryboss" )
self.assertEqual( event.commit_id, None )
self.assertEqual( event.created_at, "2012-05-20T12:29:18Z" )
self.assertEqual( event.event, None )
self.assertEqual( event.id, "1553916447" )
self.assertEqual( event.issue, None )
self.assertEqual( event.org.login, "github" )
self.assertEqual( event.payload, {u'comment': {u'body': u'+1', u'url': u'https://api.github.com/repos/github/markup/issues/comments/5808535', u'created_at': u'2012-05-20T12:29:17Z', u'updated_at': u'2012-05-20T12:29:17Z', u'user': {u'url': u'https://api.github.com/users/cherryboss', u'login': u'cherryboss', u'avatar_url': u'https://secure.gravatar.com/avatar/b3cb2e7b64cad46d1cd6e5d3294c12cc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 1078894, u'gravatar_id': u'b3cb2e7b64cad46d1cd6e5d3294c12cc'}, u'id': 5808535}, u'action': u'created', u'issue': {u'body': u"Hello, I've created support for great Texy! text-to-HTML formatter and converter library (http://texy.info, http://github.com/dg/texy).\r\n\r\nHere's my implementation branch: https://github.com/smasty/markup/tree/texy", u'labels': [], u'title': u'[new markup] Texy! formatter support', u'url': u'https://api.github.com/repos/github/markup/issues/34', u'created_at': u'2011-01-21T16:04:58Z', u'milestone': None, u'number': 34, u'comments': 23, u'updated_at': u'2012-05-20T12:29:17Z', u'assignee': None, u'html_url': u'https://github.com/github/markup/issues/34', u'state': u'open', u'user': {u'url': u'https://api.github.com/users/smasty', u'login': u'smasty', u'avatar_url': u'https://secure.gravatar.com/avatar/c27f2f0deb68f04a58db7b7254df893b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 218524, u'gravatar_id': u'c27f2f0deb68f04a58db7b7254df893b'}, u'pull_request': {u'diff_url': u'https://github.com/github/markup/pull/34.diff', u'patch_url': u'https://github.com/github/markup/pull/34.patch', u'html_url': u'https://github.com/github/markup/pull/34'}, u'closed_at': None, u'id': 541804}} ) ### @todo
self.assertEqual( event.public, True )
self.assertEqual( event.repo.name, "github/markup" ) # WTF
self.assertEqual( event.type, "IssueCommentEvent" )
self.assertEqual( event.url, None )
def testGetRepo( self ):
repo = self.g.get_user( "jacquev6" ).get_repo( "PyGithub" )
self.assertEqual( repo.description, "Python library implementing the full Github API v3" )
def testGetRepos( self ):
repo = self.g.get_user( "nvie" ).get_repos()[ 0 ]
self.assertEqual( repo.name, "git-it" )
def testGetWatched( self ):
repo = self.g.get_user( "jacquev6" ).get_watched()[ 0 ]
self.assertEqual( repo.name, "git" )
@@ -0,0 +1,15 @@
GET /users/jacquev6 {} null
200
[('status', '200 OK'), ('content-length', '801'), ('x-ratelimit-remaining', '4962'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f4938c0b6d06fb02e13ca504994d7433"'), ('date', 'Sun, 20 May 2012 12:14:07 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","url":"https://api.github.com/users/jacquev6","owned_private_repos":5,"disk_usage":16852,"plan":{"collaborators":1,"name":"micro","private_repos":5,"space":614400},"collaborators":0,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","blog":"http://vincent-jacques.net","public_repos":11,"following":24,"created_at":"2010-07-09T06:10:06Z","hireable":false,"login":"jacquev6","public_gists":1,"name":"Vincent Jacques","company":"Criteo","bio":"","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","private_gists":5,"html_url":"https://github.com/jacquev6","id":327146,"total_private_repos":5,"followers":13,"location":"Paris, France","email":"vincent@vincent-jacques.net"}
POST /users/jacquev6/gists {} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub on a NamedUser"}
201
[('status', '201 Created'), ('x-ratelimit-remaining', '4961'), ('content-length', '1461'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a0bf182f5ec61a0c78e9078da61ef220"'), ('date', 'Sun, 20 May 2012 12:14:08 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2757859')]
{"updated_at":"2012-05-20T12:14:08Z","forks":[],"url":"https://api.github.com/gists/2757859","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2757859.git","git_push_url":"git@gist.github.com:2757859.git","files":{"foobar.txt":{"type":"text/plain","size":24,"filename":"foobar.txt","raw_url":"https://gist.github.com/raw/2757859/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2757859","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},"description":"Gist created by PyGithub on a NamedUser","created_at":"2012-05-20T12:14:08Z","id":"2757859","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2757859/a371de5450f93699fe3cb0386897abe69cdc967e","committed_at":"2012-05-20T12:14:08Z","version":"a371de5450f93699fe3cb0386897abe69cdc967e","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}}]}
DELETE /gists/2757859 {} null
204
[('status', '204 No Content'), ('x-ratelimit-remaining', '4960'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sun, 20 May 2012 12:14:09 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
+10
View File
@@ -0,0 +1,10 @@
GET /users/jacquev6 {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4940'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bc486ee823927c173ad9cac98c622c9d"'), ('date', 'Sun, 20 May 2012 12:33:27 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","public_gists":1,"company":"Criteo","hireable":false,"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","private_gists":5,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"followers":13,"bio":"","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,"blog":"http://vincent-jacques.net","login":"jacquev6","email":"vincent@vincent-jacques.net","owned_private_repos":5,"disk_usage":16852,"collaborators":0,"html_url":"https://github.com/jacquev6","name":"Vincent Jacques","public_repos":11,"created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24}
GET /repos/jacquev6/PyGithub {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4939'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"922c0519f2733063a899619ae95ce892"'), ('date', 'Sun, 20 May 2012 12:33:27 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-19T10:50:39Z","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":18,"fork":false,"ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-19T10:50:39Z","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},"language":"Python","description":"Python library implementing the full Github API v3","created_at":"2012-02-25T12:53:47Z","id":3544490,"mirror_url":null}
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,10 @@
GET /users/jacquev6 {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4950'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"84f82da186c7d97ca15b538beadb8d96"'), ('date', 'Sun, 20 May 2012 12:27:02 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"collaborators":0,"type":"User","public_gists":1,"company":"Criteo","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","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","private_gists":5,"plan":{"collaborators":1,"private_repos":5,"name":"micro","space":614400},"followers":13,"hireable":false,"bio":"","login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","total_private_repos":5,"disk_usage":16852,"html_url":"https://github.com/jacquev6","name":"Vincent Jacques","created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"owned_private_repos":5,"following":24}
GET /users/jacquev6/orgs {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4949'), ('content-length', '262'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"82deae94305d8c551e4874e06f6efd48"'), ('date', 'Sun, 20 May 2012 12:27:03 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/orgs/BeaverSoftware","login":"BeaverSoftware","id":1424031}]
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,10 @@
GET /repos/jacquev6/PyGithub {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4964'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6210f1f5608548b6ccf74e191df500e5"'), ('date', 'Sun, 20 May 2012 12:10:52 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-19T10:50:39Z","forks":2,"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","open_issues":18,"fork":false,"ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-19T10:50:39Z","mirror_url":null,"size":304,"git_url":"git://github.com/jacquev6/PyGithub.git","private":false,"has_downloads":true,"watchers":13,"html_url":"https://github.com/jacquev6/PyGithub","owner":{"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},"name":"PyGithub","permissions":{"pull":true,"admin":true,"push":true},"language":"Python","description":"Python library implementing the full Github API v3","created_at":"2012-02-25T12:53:47Z","id":3544490}
GET /repos/jacquev6/PyGithub/contributors {} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4963'), ('content-length', '318'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"3ce61bc2417a6a4f7b47976a7969c711"'), ('date', 'Sun, 20 May 2012 12:10:52 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"contributions":355,"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"}]
+6
View File
@@ -55,3 +55,9 @@ class Repository( Framework.TestCase ):
self.assertEqual( repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub" )
repo.edit( "TestPyGithub", "Repository created by PyGithub", "http://vincent-jacques.net/PyGithub", public = True, has_issues = False, has_wiki = False, has_downloads = False )
self.assertEqual( repo.description, "Repository created by PyGithub" )
def testContributors( self ):
repo = self.user.get_repo( "PyGithub" )
contributor = repo.get_contributors()[ 0 ]
self.assertEqual( contributor.login, "jacquev6" )
self.assertEqual( contributor.contributions, 355 )