mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Re-implement url parameters and test them (issue #36)
This commit is contained in:
@@ -481,12 +481,20 @@ class AuthenticatedUser( object ):
|
||||
)
|
||||
return Repository.Repository( self.__requester, data, completion = NoCompletion )
|
||||
|
||||
def get_repos( self, type = DefaultValueForOptionalParameters ):
|
||||
def get_repos( self, type = DefaultValueForOptionalParameters, sort = DefaultValueForOptionalParameters, direction = DefaultValueForOptionalParameters ):
|
||||
if type is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( type, ( str, unicode ) ), type
|
||||
if sort is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( sort, ( str, unicode ) ), sort
|
||||
if direction is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( direction, ( str, unicode ) ), direction
|
||||
url_parameters = dict()
|
||||
if type is not DefaultValueForOptionalParameters:
|
||||
url_parameters[ "type" ] = type
|
||||
if sort is not DefaultValueForOptionalParameters:
|
||||
url_parameters[ "sort" ] = sort
|
||||
if direction is not DefaultValueForOptionalParameters:
|
||||
url_parameters[ "direction" ] = direction
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
"https://api.github.com/user" + "/repos",
|
||||
|
||||
@@ -747,7 +747,7 @@ class Repository( object ):
|
||||
if mentioned is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( mentioned, ( str, unicode ) ), mentioned
|
||||
if labels is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( labels, list ) and ( len( labels ) == 0 or isinstance( labels[ 0 ], ( str, unicode ) ) ), labels
|
||||
assert isinstance( labels, ( str, unicode ) ), labels
|
||||
if sort is not DefaultValueForOptionalParameters:
|
||||
assert isinstance( sort, ( str, unicode ) ), sort
|
||||
if direction is not DefaultValueForOptionalParameters:
|
||||
|
||||
Reference in New Issue
Block a user