Fix testEditOrganizationTeamAndMembers (Use _identity to fix has_in_, add_to_, remove_from_)

This commit is contained in:
Vincent Jacques
2012-05-04 15:45:08 +02:00
parent 5ae4dd1233
commit 7c749bf445
11 changed files with 144 additions and 87 deletions
+8 -3
View File
@@ -190,7 +190,7 @@ class Repository( object ):
def add_to_collaborators( self, collaborator ):
status, headers, data = self.__requester.request(
"PUT",
str( self.url ) + "/collaborators/" + str( collaborator.login ),
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
None,
None
)
@@ -767,7 +767,7 @@ class Repository( object ):
def has_in_collaborators( self, collaborator ):
status, headers, data = self.__requester.request(
"GET",
str( self.url ) + "/collaborators/" + str( collaborator.login ),
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
None,
None
)
@@ -776,11 +776,16 @@ class Repository( object ):
def remove_from_collaborators( self, collaborator ):
status, headers, data = self.__requester.request(
"DELETE",
str( self.url ) + "/collaborators/" + str( collaborator.login ),
str( self.url ) + "/collaborators/" + str( collaborator._identity ),
None,
None
)
# @todo Remove '_identity' from the normalized json description
@property
def _identity( self ):
return str( self.owner.login ) + "/" + str( self.name )
def __initAttributes( self ):
self.__clone_url = None
self.__created_at = None