def test_group_process_requestor_new(self): '''this function tests the calendar_process_requestor method on a requestor that is not already the owner of the calendar''' self.client.create(self.group_name) response = group_process_requestor('magarvey', self.group_name, False, self.client) print response assert (response == '\n<br/>magarvey (new owner)')
def test_group_process_reqiuestor_existing(self): '''this function tests the group_process_requestor method on a requestor that is already the owner of the calendar''' response = group_process_requestor('magarvey', 'abc_group', True, self.client) assert (response == '\n<br/>magarvey (already owner)')
#create success message response = process_group( group_name, group_description, group_already_exists, success ) if group_requestor_1: try: if requestor_validate( group_requestor_1, client ): requestor_1_already_owner = group_already_owner( group_requestor_1, group_name, client ) response += group_process_requestor( group_requestor_1, group_name, requestor_1_already_owner, client ) else: response += '\n<br/>' + group_requestor_1 + \ ' is not a valid user' except Exception, err: response += '\n<br/>' + str(err) if group_requestor_2: try: if requestor_validate( group_requestor_2, client ): requestor_2_already_owner = group_already_owner( group_requestor_2, group_name, client )
def test_group_process_requestor_invalid(self): '''this function tests the group_process_requestor method on a requestor with some invalid chars in the requestor's name (... to trigger the exception)''' response = group_process_requestor('', 'abc_group', False, self.client) assert (response.startswith('\n<br/> is invalid user'))