def test_Processor_failed_execute_step_request(self): request = ExecuteStepRequest() response = processor.process_execute_step_request(request) self.assertTrue(isinstance(response, ExecutionStatusResponse)) self.assertEqual(True, response.executionResult.failed) self.assertEqual(ProtoExecutionResult.ASSERTION, response.executionResult.errorType) self.assertNotEqual('', response.executionResult.errorMessage) self.assertNotEqual('', response.executionResult.stackTrace) self.assertEqual(False, response.executionResult.recoverableError)
def test_Processor_execute_step_request(self): registry.add_step('Step 4', impl1, '') request = ExecuteStepRequest() request.parsedStepText = 'Step 4' response = processor.process_execute_step_request(request) self.assertTrue(isinstance(response, ExecutionStatusResponse)) self.assertEqual(False, response.executionResult.failed) self.assertEqual('', response.executionResult.errorMessage) self.assertEqual('', response.executionResult.stackTrace)
def test_Processor_failed_execute_step_request_with_continue_on_failure( self): registry.add_step('Step 4', failing_impl, '') registry.continue_on_failure(failing_impl, [IndexError]) request = ExecuteStepRequest() request.parsedStepText = 'Step 4' response = processor.process_execute_step_request(request) self.assertTrue(isinstance(response, ExecutionStatusResponse)) self.assertEqual(True, response.executionResult.failed) self.assertEqual(ProtoExecutionResult.ASSERTION, response.executionResult.errorType) self.assertNotEqual('', response.executionResult.errorMessage) self.assertNotEqual('', response.executionResult.stackTrace) self.assertEqual(True, response.executionResult.recoverableError)
def test_Processor_execute_step_request_with_param(self): registry.add_step('Step <a> with <b>', impl, '') registry.add_step('Step 4', 'func1', '') request = ExecuteStepRequest() request.parsedStepText = 'Step {} with {}' parameter = Parameter() parameter.value = 'param 1' parameter1 = Parameter() parameter1.value = 'param 2' request.parameters.extend([parameter, parameter1]) response = processor.process_execute_step_request(request) self.assertTrue(isinstance(response, ExecutionStatusResponse)) self.assertEqual(False, response.executionResult.failed) self.assertEqual('', response.executionResult.errorMessage) self.assertEqual('', response.executionResult.stackTrace)
def ExecuteStep(self, request, context): return processor.process_execute_step_request(request)