Reduce differences between generated code and correct code

This commit is contained in:
Vincent Jacques
2012-05-27 13:06:50 +01:00
parent 306e43bbff
commit 5aceaa19f2
8 changed files with 189 additions and 20 deletions
-2
View File
@@ -45,7 +45,6 @@ class Label( object ):
)
self.__useAttributes( data )
# @todo Remove '_identity' from the normalized json description
@property
def _identity( self ):
return urllib.quote( self.name )
@@ -56,7 +55,6 @@ class Label( object ):
self.__url = None
def __useAttributes( self, attributes ):
# @todo No need to check if attribute is in attributes when attribute is mandatory
if "color" in attributes and attributes[ "color" ] is not None: # pragma no branch
self.__color = attributes[ "color" ]
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
+5 -1
View File
@@ -240,11 +240,15 @@ class PullRequest( object ):
return status == 204
def merge( self, commit_message = DefaultValueForOptionalParameters ):
post_parameters = {
}
if commit_message is not DefaultValueForOptionalParameters:
post_parameters[ "commit_message" ] = commit_message
status, headers, data = self.__requester.request(
"PUT",
str( self.url ) + "/merge",
None,
{}
post_parameters
)
def __initAttributes( self ):
+1 -1
View File
@@ -584,7 +584,7 @@ class Repository( object ):
def get_git_ref( self, ref ):
status, headers, data = self.__requester.request(
"GET",
str( self.url ) + "/git" + "/" + str( ref ),
str( self.url ) + "/git/" + str( ref ),
None,
None
)