Merge branch 'develop'

This commit is contained in:
Vincent Jacques
2012-06-29 18:54:35 +01:00
32 changed files with 466 additions and 33 deletions
+16
View File
@@ -57,6 +57,22 @@ API `/issues`
=============
* GET: `AuthenticatedUser.get_issues`
API `/legacy/issues/search/:owner/:repository/:state/:keyword`
==============================================================
* GET: `Repository.search_issues`
API `/legacy/repos/search/:keyword`
==============================================================
* GET: `Github.search_repos`
API `/legacy/user/search/:keyword`
==============================================================
* GET: `Github.search_users`
API `/legacy/user/email/:email`
==============================================================
* GET: `Github.search_user_by_email`
API `/networks/:user/:repo/events`
==================================
* GET: `Repository.get_network_events`
+12
View File
@@ -20,7 +20,16 @@ Methods
* `get_user( login )`: `NamedUser`
* `get_organization( login )`: `Organization`
* `get_gist( id )`: `Gist`
* `id`: integer
* `get_gists()`: list of `Gist`
* `search_repos( keyword )`: list of `Repository`
* `legacy_search_repos( keyword, [language] )`: list of `Repository`
* `keyword`: string
* `language`: string
* `legacy_search_users( keyword )`: list of `NamedUser`
* `keyword`: string
* `legacy_search_user_by_email( email )`: `NamedUser`
* `email`: string
Class `GithubException`
=======================
@@ -1191,6 +1200,9 @@ Issues
* `sort`: string
* `direction`: string
* `since`: datetime
* `legacy_search_issues( state, keyword )`: list of `Issue`
* `state`: "open" or "closed"
* `keyword`: string
Issues_events
-------------
+37
View File
@@ -17,6 +17,9 @@ import NamedUser
import Organization
import Gist
import PaginatedList
import Repository
import Legacy
import GithubObject
class Github( object ):
def __init__( self, login_or_token = None, password = None ):
@@ -64,3 +67,37 @@ class Github( object ):
headers,
data
)
def legacy_search_repos( self, keyword, language = GithubObject.NotSet ):
assert isinstance( keyword, ( str, unicode ) ), keyword
assert language is GithubObject.NotSet or isinstance( language, ( str, unicode ) ), language
args = {} if language is GithubObject.NotSet else { "language": language }
return Legacy.PaginatedList(
"https://api.github.com/legacy/repos/search/" + keyword,
args,
self.__requester,
"repositories",
Legacy.convertRepo,
Repository.Repository,
)
def legacy_search_users( self, keyword ):
assert isinstance( keyword, ( str, unicode ) ), keyword
return Legacy.PaginatedList(
"https://api.github.com/legacy/user/search/" + keyword,
{},
self.__requester,
"users",
Legacy.convertUser,
NamedUser.NamedUser,
)
def legacy_search_user_by_email( self, email ):
assert isinstance( email, ( str, unicode ) ), email
headers, data = self.__requester.requestAndCheck(
"GET",
"https://api.github.com/legacy/user/email/" + email,
None,
None
)
return NamedUser.NamedUser( self.__requester, Legacy.convertUser( data[ "user" ] ), completed = False )
+2 -2
View File
@@ -120,7 +120,7 @@ class Issue( GithubObject.GithubObject ):
def add_to_labels( self, *labels ):
assert all( isinstance( element, Label.Label ) for element in labels ), labels
post_parameters = [ label._identity for label in labels ]
post_parameters = [ label.name for label in labels ]
headers, data = self._requester.requestAndCheck(
"POST",
self.url + "/labels",
@@ -240,7 +240,7 @@ class Issue( GithubObject.GithubObject ):
def set_labels( self, *labels ):
assert all( isinstance( element, Label.Label ) for element in labels ), labels
post_parameters = [ label._identity for label in labels ]
post_parameters = [ label.name for label in labels ]
headers, data = self._requester.requestAndCheck(
"PUT",
self.url + "/labels",
+74
View File
@@ -0,0 +1,74 @@
# 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/>.
from PaginatedList import PaginatedListBase
class PaginatedList( PaginatedListBase ):
def __init__( self, url, args, requester, key, convert, contentClass ):
PaginatedListBase.__init__( self, list() )
self.__url = url
self.__args = args
self.__requester = requester
self.__key = key
self.__convert = convert
self.__contentClass = contentClass
self.__nextPage = 1
self.__continue = True
self.__elements = list()
def _couldGrow( self ):
return self.__continue
def _fetchNextPage( self ):
if self.__nextPage != 1:
self.__args[ "start_page" ] = self.__nextPage
self.__nextPage += 1
headers, data = self.__requester.requestAndCheck(
"GET",
self.__url,
self.__args,
None
)
self.__continue = len( data[ self.__key ] ) > 0
return [
self.__contentClass( self.__requester, self.__convert( element ), completed = False )
for element in data[ self.__key ]
]
def convertUser( attributes ):
login = attributes[ "login" ]
return {
"login": login,
"url": "https://api.github.com/users/" + login,
}
def convertRepo( attributes ):
owner = attributes[ "owner" ]
name = attributes[ "name" ]
return {
"owner": { "login": owner },
"name": name,
"url": "https://api.github.com/repos/" + owner + "/" + name,
}
def convertIssue( attributes ):
number = attributes[ "number" ]
title = attributes[ "title" ]
html_url = attributes[ "html_url" ]
assert html_url.startswith( "https://github.com/" )
url = html_url.replace( "https://github.com/", "https://api.github.com/repos/" )
return {
"title": title,
"number": number,
"url": url,
}
+37 -29
View File
@@ -13,22 +13,39 @@
import GithubObject
class PaginatedList:
def __init__( self, contentClass, requester, headers, data ):
self.__requester = requester
self.__contentClass = contentClass
self.__elements = []
self.__appendData( headers, data )
class PaginatedListBase:
def __init__( self, firstElements ):
self.__elements = firstElements
def __getitem__( self, index ):
assert isinstance( index, ( int, slice ) )
if isinstance( index, int ):
self.__fetchToIndex( index )
return self.__elements[ index ]
else:
return self._Slice( self, index )
def __iter__( self ):
for element in self.__elements:
yield element
while self.__nextUrl is not None:
newElements = self.__fetchNextPage()
while self._couldGrow():
newElements = self.__grow()
for element in newElements:
yield element
class __Slice:
def _isBiggerThan( self, index ):
return len( self.__elements ) > index or self._couldGrow()
def __fetchToIndex( self, index ):
while len( self.__elements ) <= index and self._couldGrow():
self.__grow()
def __grow( self ):
newElements = self._fetchNextPage()
self.__elements += newElements
return newElements
class _Slice:
def __init__( self, theList, theSlice ):
self.__list = theList
self.__start = theSlice.start or 0
@@ -47,39 +64,30 @@ class PaginatedList:
def __finished( self, index ):
return self.__stop is not None and index >= self.__stop
def __getitem__( self, index ):
assert isinstance( index, ( int, slice ) )
if isinstance( index, int ):
self.__fetchToIndex( index )
return self.__elements[ index ]
else:
return self.__Slice( self, index )
class PaginatedList( PaginatedListBase ):
def __init__( self, contentClass, requester, headers, data ):
self.__requester = requester
self.__contentClass = contentClass
PaginatedListBase.__init__( self, self.__extractNewElements( headers, data ) )
def _isBiggerThan( self, index ):
return len( self.__elements ) > index or self.__nextUrl is not None
def _couldGrow( self ):
return self.__nextUrl is not None
def __fetchToIndex( self, index ):
while len( self.__elements ) <= index and self.__nextUrl is not None:
self.__fetchNextPage()
def __fetchNextPage( self ):
def _fetchNextPage( self ):
headers, data = self.__requester.requestAndCheck( "GET", self.__nextUrl, None, None )
return self.__appendData( headers, data )
return self.__extractNewElements( headers, data )
def __appendData( self, headers, data ):
def __extractNewElements( self, headers, data ):
links = self.__parseLinkHeader( headers )
if len( data ) > 0 and "next" in links:
self.__nextUrl = links[ "next" ]
else:
self.__nextUrl = None
newElements = [
return [
self.__contentClass( self.__requester, element, completed = False )
for element in data
]
self.__elements += newElements
return newElements
def __parseLinkHeader( self, headers ):
links = {}
+17 -2
View File
@@ -46,6 +46,7 @@ import GitTag
import Download
import Permissions
import Event
import Legacy
class Repository( GithubObject.GithubObject ):
@property
@@ -367,7 +368,7 @@ class Repository( GithubObject.GithubObject ):
if milestone is not GithubObject.NotSet:
post_parameters[ "milestone" ] = milestone._identity
if labels is not GithubObject.NotSet:
post_parameters[ "labels" ] = [ element._identity for element in labels ]
post_parameters[ "labels" ] = [ element.name for element in labels ]
headers, data = self._requester.requestAndCheck(
"POST",
self.url + "/issues",
@@ -764,7 +765,7 @@ class Repository( GithubObject.GithubObject ):
if mentioned is not GithubObject.NotSet:
url_parameters[ "mentioned" ] = mentioned._identity
if labels is not GithubObject.NotSet:
url_parameters[ "labels" ] = ",".join( label._identity for label in labels )
url_parameters[ "labels" ] = ",".join( label.name for label in labels )
if sort is not GithubObject.NotSet:
url_parameters[ "sort" ] = sort
if direction is not GithubObject.NotSet:
@@ -1002,6 +1003,20 @@ class Repository( GithubObject.GithubObject ):
None
)
def legacy_search_issues( self, state, keyword ):
assert state in [ "open", "closed" ], state
assert isinstance( keyword, ( str, unicode ) ), keyword
headers, data = self._requester.requestAndCheck(
"GET",
"https://api.github.com/legacy/issues/search/" + self.owner.login + "/" + self.name + "/" + state + "/" + keyword,
{},
None
)
return [
Issue.Issue( self._requester, Legacy.convertIssue( element ), completed = False )
for element in data[ "issues" ]
]
@property
def _identity( self ):
return self.owner.login + "/" + self.name
+25
View File
@@ -16,3 +16,28 @@ 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" )
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 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 ):
self.assertListKeyBegin( self.g.legacy_search_users( "vincent" ), lambda u: u.login, [ "nvie", "obra", "lusis" ] )
def testLegacySearchUsersPagination( self ):
self.assertEqual( len( list( self.g.legacy_search_users( "Lucy" ) ) ), 146 )
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 )
+1
View File
@@ -51,6 +51,7 @@ from UserKey import *
from PaginatedList import *
from Issue33 import *
from Issue50 import *
from Exceptions import *
Framework.main()
+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 )
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 /legacy/user/email/vincent@vincent-jacques.net {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4999'), ('content-length', '395'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f225d9662153996a309db055598b3c8b"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Fri, 29 Jun 2012 11:37:11 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"user":{"email":"vincent@vincent-jacques.net","blog":"http://vincent-jacques.net","name":"Vincent Jacques","location":"Paris, France","created_at":"2010-07-08T23:10:06-07:00","followers_count":13,"company":"Criteo","type":"User","permission":null,"public_repo_count":11,"public_gist_count":3,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"following_count":24}}
GET /users/jacquev6 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '801'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4998'), ('server', 'nginx/1.0.13'), ('last-modified', 'Fri, 15 Jun 2012 15:37:06 GMT'), ('connection', 'keep-alive'), ('etag', '"41ade9c2e4794dd5214bb5f497af92cb"'), ('cache-control', 'private, max-age=60'), ('date', 'Fri, 29 Jun 2012 11:37:11 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"following":24,"created_at":"2010-07-09T06:10:06Z","type":"User","hireable":false,"private_gists":5,"collaborators":0,"public_repos":11,"followers":13,"company":"Criteo","bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","plan":{"collaborators":1,"private_repos":5,"space":614400,"name":"micro"},"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","total_private_repos":5,"disk_usage":16812,"location":"Paris, France","owned_private_repos":5,"login":"jacquev6","html_url":"https://github.com/jacquev6","name":"Vincent Jacques","url":"https://api.github.com/users/jacquev6","id":327146,"public_gists":3,"blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net"}
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 @@
GET /legacy/user/email/vincent@vincent-jacques.net {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('content-length', '395'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"baf55235e157428f731c446efe6d6cba"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 20:58:11 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","type":"User","location":"Paris, France","blog":"http://vincent-jacques.net","name":"Vincent Jacques","permission":null,"public_repo_count":11,"login":"jacquev6","email":"vincent@vincent-jacques.net","public_gist_count":3,"created_at":"2010-07-08T23:10:06-07:00","id":327146,"followers_count":13,"following_count":24,"company":"Criteo"}}
File diff suppressed because one or more lines are too long
+15
View File
@@ -0,0 +1,15 @@
GET /user {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4892'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('last-modified', 'Fri, 15 Jun 2012 15:37:06 GMT'), ('connection', 'keep-alive'), ('etag', '"41ade9c2e4794dd5214bb5f497af92cb"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:04 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"following":24,"created_at":"2010-07-09T06:10:06Z","type":"User","private_gists":5,"public_repos":11,"followers":13,"hireable":false,"html_url":"https://github.com/jacquev6","bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","disk_usage":16820,"blog":"http://vincent-jacques.net","location":"Paris, France","total_private_repos":5,"login":"jacquev6","owned_private_repos":5,"collaborators":0,"name":"Vincent Jacques","company":"Criteo","url":"https://api.github.com/users/jacquev6","plan":{"space":614400,"private_repos":5,"collaborators":1,"name":"micro"},"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_gists":3,"email":"vincent@vincent-jacques.net"}
GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '1154'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4891'), ('server', 'nginx/1.0.13'), ('last-modified', 'Tue, 26 Jun 2012 12:30:06 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"eb3fdb98c65995892b016162b91ad68c"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:05 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"homepage":"http://vincent-jacques.net/PyGithub","owner":{"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","url":"https://api.github.com/users/jacquev6","id":327146},"open_issues":12,"mirror_url":null,"git_url":"git://github.com/jacquev6/PyGithub.git","permissions":{"push":true,"admin":true,"pull":true},"description":"Python library implementing the full Github API v3","master_branch":"master","has_issues":true,"svn_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub","has_downloads":true,"size":184,"fork":false,"created_at":"2012-02-25T12:53:47Z","html_url":"https://github.com/jacquev6/PyGithub","name":"PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","language":"Python","clone_url":"https://github.com/jacquev6/PyGithub.git","private":false,"pushed_at":"2012-06-20T21:03:27Z","id":3544490,"forks":5,"has_wiki":false,"watchers":29,"ssh_url":"git@github.com:jacquev6/PyGithub.git","updated_at":"2012-06-26T12:30:06Z"}
GET /repos/jacquev6/PyGithub/issues/50 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '2169'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4890'), ('server', 'nginx/1.0.13'), ('last-modified', 'Wed, 27 Jun 2012 22:46:10 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bb61450865a934ca7ee53d6dde588876"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:05 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"labels":[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}],"body":null,"state":"open","closed_at":null,"assignee":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","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","id":327146},"comments":2,"title":"[Issue] Replace label _identity with name","created_at":"2012-06-25T18:45:05Z","number":50,"milestone":{"open_issues":3,"state":"open","due_on":"2012-07-01T07:00:00Z","description":"","creator":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","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","id":327146},"closed_issues":0,"title":"Version 1.2","created_at":"2012-06-25T19:31:02Z","number":6,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/6","id":136827},"html_url":"https://github.com/jacquev6/PyGithub/issues/50","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/50","closed_by":null,"user":{"login":"philipkimmey","gravatar_id":"6baf93a46e584369e1ea64bc1aca62f4","url":"https://api.github.com/users/philipkimmey","avatar_url":"https://secure.gravatar.com/avatar/6baf93a46e584369e1ea64bc1aca62f4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":211079},"id":5256315,"pull_request":{"diff_url":"https://github.com/jacquev6/PyGithub/pull/50.diff","patch_url":"https://github.com/jacquev6/PyGithub/pull/50.patch","html_url":"https://github.com/jacquev6/PyGithub/pull/50"},"updated_at":"2012-06-25T19:33:48Z"}
@@ -0,0 +1,10 @@
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4918'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:54:44 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
POST /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Label with spaces and strange characters (&*#$)"]
200
[('status', '200 OK'), ('content-length', '419'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4917'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1d0a1c54608a676af0cdc1f63e04da7"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:54:44 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}]
@@ -0,0 +1,10 @@
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4908'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:56:20 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
POST /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"labels": ["Label with spaces and strange characters (&*#$)"], "title": "Issue created by PyGithub to test issue #50"}
201
[('status', '201 Created'), ('content-length', '963'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4907'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1e5db9ef97e084a3d36ede8dc41c0d9"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/52'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:56:21 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"labels":[{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}],"body":null,"state":"open","closed_at":null,"assignee":null,"comments":0,"title":"Issue created by PyGithub to test issue #50","created_at":"2012-06-28T19:56:21Z","number":52,"milestone":null,"html_url":"https://github.com/jacquev6/PyGithub/issues/52","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/52","closed_by":null,"user":{"login":"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","url":"https://api.github.com/users/jacquev6","id":327146},"id":5330629,"pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"updated_at":"2012-06-28T19:56:21Z"}
@@ -0,0 +1,5 @@
POST /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} {"color": "ffff00", "name": "Label with spaces and strange characters (&*#$)"}
201
[('status', '201 Created'), ('content-length', '197'), ('etag', '"99cbb3bf0f7ee7d6278c2ddd3ef42577"'), ('x-ratelimit-remaining', '4968'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
@@ -0,0 +1,10 @@
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4894'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '197'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:03:09 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
GET /repos/jacquev6/PyGithub/issues?labels=Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '3101'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4893'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:56:21 GMT'), ('connection', 'keep-alive'), ('etag', '"60a85542a2e824eb5fc96c5a99657fff"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:03:10 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"labels":[{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}],"body":null,"state":"open","closed_at":null,"assignee":null,"comments":0,"title":"Issue created by PyGithub to test issue #50","created_at":"2012-06-28T19:56:21Z","number":52,"milestone":null,"html_url":"https://github.com/jacquev6/PyGithub/issues/52","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/52","user":{"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","url":"https://api.github.com/users/jacquev6","id":327146},"id":5330629,"pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"updated_at":"2012-06-28T19:56:21Z"},{"labels":[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}],"body":null,"state":"open","closed_at":null,"assignee":{"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","url":"https://api.github.com/users/jacquev6","id":327146},"comments":2,"title":"[Issue] Replace label _identity with name","created_at":"2012-06-25T18:45:05Z","number":50,"milestone":{"open_issues":3,"state":"open","due_on":"2012-07-01T07:00:00Z","description":"","creator":{"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","url":"https://api.github.com/users/jacquev6","id":327146},"closed_issues":0,"title":"Version 1.2","created_at":"2012-06-25T19:31:02Z","number":6,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/6","id":136827},"html_url":"https://github.com/jacquev6/PyGithub/issues/50","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/50","user":{"avatar_url":"https://secure.gravatar.com/avatar/6baf93a46e584369e1ea64bc1aca62f4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"philipkimmey","gravatar_id":"6baf93a46e584369e1ea64bc1aca62f4","url":"https://api.github.com/users/philipkimmey","id":211079},"id":5256315,"pull_request":{"diff_url":"https://github.com/jacquev6/PyGithub/pull/50.diff","patch_url":"https://github.com/jacquev6/PyGithub/pull/50.patch","html_url":"https://github.com/jacquev6/PyGithub/pull/50"},"updated_at":"2012-06-25T19:33:48Z"}]
+5
View File
@@ -0,0 +1,5 @@
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '197'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4964'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:32:14 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
@@ -0,0 +1,5 @@
GET /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '1015'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4953'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:36:59 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"color":"0b02e1","name":"Refactoring","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Refactoring"},{"color":"d7e102","name":"Public interface","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Public+interface"},{"color":"e102d8","name":"Functionalities","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Functionalities"},{"color":"444444","name":"Project management","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management"},{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"02e10c","name":"Question","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}]
@@ -0,0 +1,5 @@
GET /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4903'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '419'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:57:21 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}]
@@ -0,0 +1,10 @@
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '197'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4937'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:43:02 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
DELETE /repos/jacquev6/PyGithub/issues/50/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '221'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4936'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"f52869e02750b4a36166ec2d23c2f471"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:43:02 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}]
@@ -0,0 +1,20 @@
GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '97'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4889'), ('server', 'nginx/1.0.13'), ('last-modified', 'Sat, 20 Oct 2007 11:24:19 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"147027ac86c95043e935b318f88c3683"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:06 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"}
GET /repos/jacquev6/PyGithub/labels/RequestedByUser {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '121'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4888'), ('server', 'nginx/1.0.13'), ('last-modified', 'Sat, 20 Oct 2007 11:24:19 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"147027ac86c95043e935b318f88c3683"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:06 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}
GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4887'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '197'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:07 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}
PUT /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Bug", "RequestedByUser", "Label with spaces and strange characters (&*#$)"]
200
[('status', '200 OK'), ('content-length', '419'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4886'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1d0a1c54608a676af0cdc1f63e04da7"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 20:04:08 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}]
@@ -0,0 +1,5 @@
GET /legacy/issues/search/jacquev6/PyGithub/open/search {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '875'), ('x-ratelimit-remaining', '4990'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1178425a2730e43d21323c7e130c863c"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Fri, 29 Jun 2012 11:38:23 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"issues":[{"number":49,"gravatar_id":"9be6ba907be1740213b69422fdf52b57","updated_at":"2012-06-28T14:13:25-07:00","user":"kukuts","votes":0,"html_url":"https://github.com/jacquev6/PyGithub/issues/49","position":1.0,"comments":4,"title":"Support new Search API","labels":["Functionalities","RequestedByUser"],"created_at":"2012-06-21T05:27:38-07:00","state":"open","body":"New API ported from v2 but i have trouble with adopting ask's library for v2 API to support v3 style for searching. \nhttp://developer.github.com/v3/search/\n\nIts not described in the page about parameters that search for repos API supports.\nThey are same as in v2 API, you can look them in ask's library.\nIn v2 was like that https://github.com/api/v2/json/repos/search/testing?start_page=2&language=Python\nIn v3 is https://api.github.com/legacy/repos/search/testing?start_page=2&language=Python"}]}
@@ -0,0 +1,5 @@
GET /legacy/issues/search/jacquev6/PyGithub/open/search {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '875'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4985'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"2e397de657b33283e77ef12a21326d0d"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 20:39:57 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"issues":[{"title":"Support new Search API","number":49,"user":"kukuts","html_url":"https://github.com/jacquev6/PyGithub/issues/49","labels":["Functionalities","RequestedByUser"],"body":"New API ported from v2 but i have trouble with adopting ask's library for v2 API to support v3 style for searching. \nhttp://developer.github.com/v3/search/\n\nIts not described in the page about parameters that search for repos API supports.\nThey are same as in v2 API, you can look them in ask's library.\nIn v2 was like that https://github.com/api/v2/json/repos/search/testing?start_page=2&language=Python\nIn v3 is https://api.github.com/legacy/repos/search/testing?start_page=2&language=Python","votes":0,"comments":2,"updated_at":"2012-06-25T12:31:14-07:00","gravatar_id":"9be6ba907be1740213b69422fdf52b57","position":1.0,"state":"open","created_at":"2012-06-21T05:27:38-07:00"}]}
+3
View File
@@ -332,3 +332,6 @@ class Repository( Framework.TestCase ):
def testGetPullsWithArguments( self ):
self.assertListKeyEqual( self.repo.get_pulls( "closed" ), lambda p: p.id, [ 1448168, 1436310, 1436215 ] )
def testLegacySearchIssues( self ):
self.assertListKeyEqual( self.repo.legacy_search_issues( "open", "search" ), lambda i: i.title, [ "Support new Search API" ] )