Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_processor_refactor_request_with_insert_param(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = True
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.oldStepValue.parameterizedStepValue = 'Vowels in English language are .'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {} {}.'
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is <a> .'
request.refactorRequest.newStepValue.parameters.extend(['a', 'vowels'])
param1_position = ParameterPosition()
param1_position.oldPosition = -1
param1_position.newPosition = 0
param2_position = ParameterPosition()
param2_position.oldPosition = 0
param2_position.newPosition = 1</a>
def test_Processor_refactor_request_with_add_and_remove_param(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = True
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is .'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {}.'
request.refactorRequest.newStepValue.parameters.extend(['bsdfdsf'])
param_position = ParameterPosition()
param_position.oldPosition = -1
param_position.newPosition = 0
request.refactorRequest.paramPositions.extend([param_position])
processor.refactor_step(request.refactorRequest, response, None)
actual_data = self.getActualText()
self.assertEqual(Message.RefactorResponse, response.messageType)
def test_Processor_refactor_request_with_add_param(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = True
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is \
.'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {} {}.'
request.refactorRequest.newStepValue.parameters.extend(['vowels', 'bsdfdsf'])
position = ParameterPosition()
position.oldPosition = 0
position.newPosition = 0
param_position = ParameterPosition()
param_position.oldPosition = -1
param_position.newPosition = 1
request.refactorRequest.paramPositions.extend([position, param_position])
def test_Processor_refactor_request_without_save_changes_add_param_and_invalid_identifier(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = False
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is \
.'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {} {}.'
request.refactorRequest.newStepValue.parameters.extend(['vowels', 'vowels!2_ab%$'])
position = ParameterPosition()
position.oldPosition = 0
position.newPosition = 0
param_position = ParameterPosition()
param_position.oldPosition = -1
param_position.newPosition = 1
request.refactorRequest.paramPositions.extend([position, param_position])
def test_create_execution_context_from(self):
message = Message()
spec_name = 'SPEC_NAME'
spec_file_name = 'SPEC_FILE_NAME'
scenario_name = 'SCENARIO_NAME'
step_name = 'STEP_NAME'
message.executionStartingRequest.\
currentExecutionInfo.currentSpec.name = spec_name
message.executionStartingRequest.\
currentExecutionInfo.currentSpec.fileName = spec_file_name
message.executionStartingRequest.\
currentExecutionInfo.currentSpec.isFailed = True
message.executionStartingRequest.\
currentExecutionInfo.currentScenario.name = scenario_name
message.executionStartingRequest.\
currentExecutionInfo.currentScenario.isFailed = False
message.executionStartingRequest.\
def test_Processor_refactor_request_without_save_change_with_add_param(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = False
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language \
is .'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {} {}.'
request.refactorRequest.newStepValue.parameters.extend(['vowels', 'bsdfdsf'])
position = ParameterPosition()
position.oldPosition = 0
position.newPosition = 0
param_position = ParameterPosition()
param_position.oldPosition = -1
param_position.newPosition = 1
request.refactorRequest.paramPositions.extend([position, param_position])
def test_Processor_refactor_request(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = True
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is .'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {}.'
request.refactorRequest.newStepValue.parameters.extend(['vowels'])
position = ParameterPosition()
position.oldPosition = 0
position.newPosition = 0
request.refactorRequest.paramPositions.extend([position])
processor.refactor_step(request.refactorRequest, response, None)
actual_data = self.getActualText()
self.assertEqual(Message.RefactorResponse, response.messageType)
def test_Processor_refactor_request(self):
response = Message()
request = Message()
request.refactorRequest.saveChanges = True
request.refactorRequest.oldStepValue.stepValue = 'Vowels in English language are {}.'
request.refactorRequest.oldStepValue.parameters.append('vowels')
request.refactorRequest.newStepValue.parameterizedStepValue = 'Vowels in English language is .'
request.refactorRequest.newStepValue.stepValue = 'Vowels in English language is {}.'
request.refactorRequest.newStepValue.parameters.extend(['vowels'])
position = ParameterPosition()
position.oldPosition = 0
position.newPosition = 0
request.refactorRequest.paramPositions.extend([position])
processor.refactor_step(request.refactorRequest, response, None)
actual_data = self.getActualText()
def ValidateStep(self, request, context):
res = Message()
validator.validate_step(request, res)
return res.stepValidateResponse
def GetStepName(self, request, context):
res = Message()
info = registry.get_info_for(request.stepValue)
processor.step_name_response(info, res)
return res.stepNameResponse