def test_group_add_owner_new(self): '''this function tests the group_add_owner method for a valid user not already owner of the group''' self.client.create(self.group_name) group_already_exists, success = \ group_validate(self.group_name, '', self.client) group_already_owner_start = group_already_owner('magarvey', self.group_name, self.client) try: subscribed, owner = group_add_owner('magarvey', self.group_name, self.client) group_add_owner_success = True except: group_add_owner_success = False group_already_exists, success = \ group_validate(self.group_name, '', self.client) sleep(5) group_already_owner_end = group_already_owner('magarvey', self.group_name, self.client) '''DEBUGGIN''' print str(self.client.status(self.group_name)) print str(group_already_owner('magarvey',self.group_name,self.client)) assert group_already_exists assert (group_already_owner_start == False) assert (success == False) assert group_add_owner_success assert subscribed assert owner assert group_already_owner_end
def test_group_add_owner_existing(self): '''this function tests the group_add_owner method on a group that the user is already owner of''' group_already_exists, success = \ group_validate('abc_calendar', '', self.client) group_already_owner_start = group_already_owner('magarvey', 'abc_group', self.client) try: group_add_owner('magarvey', 'abc_group', self.client) group_add_owner_success = True except: group_add_owner_success = False group_already_owner_end = group_already_owner('magarvey','abc_group',self.client) assert group_already_exists assert group_already_owner_start assert group_already_owner_end assert (success == False) assert (group_add_owner_success == True)
def test_group_add_owner_invalid(self): '''this function tests the group_add_owner method on a user that is not in the gtest.pdx.edu system''' group_already_exists, success = \ group_validate('abc_group', '', self.client) try: group_already_owner_start = group_already_owner('?//%/$/#@', 'abc_group', self.client) except: group_already_owner_start = False try: subscribed, owner = group_add_owner('?//%/$/#@', 'abc_group', self.client) group_add_owner_success = True except: group_add_owner_success = False assert group_already_exists assert (group_already_owner_start == False) assert (success == False) assert (group_add_owner_success == True) assert (subscribed == False) assert (owner == False)