def _translate_input_test(self, tpl_snippet, input_params, expectedmessage=None): inputs_dict = (translator.toscalib.utils.yamlparser. simple_parse(tpl_snippet)['inputs']) inputs = [] for name, attrs in inputs_dict.items(): input = Input(name, attrs) inputs.append(input) translateinput = TranslateInputs(inputs, input_params) try: translateinput.translate() except ValueError: pass except Exception as err: self.assertEqual(expectedmessage, err.__str__())
def _translate_input_test(self, tpl_snippet, input_params, expectedmessage=None, expected_hot_params=None): inputs_dict = (toscaparser.utils.yamlparser. simple_parse(tpl_snippet)['inputs']) inputs = [] for name, attrs in inputs_dict.items(): input = Input(name, attrs) inputs.append(input) translateinput = TranslateInputs(inputs, input_params) try: resulted_hot_params = translateinput.translate() if expected_hot_params: self._compare_hot_params(resulted_hot_params, expected_hot_params) except Exception as err: self.assertEqual(expectedmessage, err.__str__())
def _translate_input_test(self, tpl_snippet, input_params, expectedmessage=None): inputs_dict = (translator.toscalib.utils.yamlparser.simple_parse( tpl_snippet)['inputs']) inputs = [] for name, attrs in inputs_dict.items(): input = Input(name, attrs) inputs.append(input) translateinput = TranslateInputs(inputs, input_params) try: translateinput.translate() except ValueError: pass except Exception as err: self.assertEqual(expectedmessage, err.__str__())
def _translate_input_test(self, tpl_snippet, input_params, expectedmessage=None, expected_hot_params=None): inputs_dict = ( toscaparser.utils.yamlparser.simple_parse(tpl_snippet)['inputs']) inputs = [] for name, attrs in inputs_dict.items(): input = Input(name, attrs) inputs.append(input) translateinput = TranslateInputs(inputs, input_params) try: resulted_hot_params = translateinput.translate() if expected_hot_params: self._compare_hot_params(resulted_hot_params, expected_hot_params) except Exception as err: self.assertEqual(expectedmessage, err.__str__())
def _translate_inputs(self): translator = TranslateInputs(self.tosca.inputs, self.parsed_params) return translator.translate()
def _translate_inputs(self): translator = TranslateInputs(self.tosca.inputs, self.parsed_params, self.deploy) return translator.translate()