Exemplo n.º 1
0
    def test_deployment_prompt_alphabetical_order(self):
        # check that params are prompted for in alphabetical order when the file is loaded with preserve_order=False
        curr_dir = os.path.dirname(os.path.realpath(__file__))
        template_path = os.path.join(curr_dir,
                                     'param-validation-template.json').replace(
                                         '\\', '\\\\')
        parameters_path = os.path.join(curr_dir,
                                       'param-validation-params.json').replace(
                                           '\\', '\\\\')
        parameters_with_reference_path = os.path.join(
            curr_dir,
            'param-validation-ref-params.json').replace('\\', '\\\\')

        template = get_file_json(template_path, preserve_order=False)
        template_param_defs = template.get('parameters', {})

        parameter_list = [[parameters_path], [parameters_with_reference_path]]
        result_parameters = _process_parameters(template_param_defs,
                                                parameter_list)
        missing_parameters = _find_missing_parameters(result_parameters,
                                                      template)

        param_alpha_order = [
            "[u'arrayParam', u'boolParam', u'enumParam', u'objectParam', u'secureParam']",
            "['arrayParam', 'boolParam', 'enumParam', 'objectParam', 'secureParam']"
        ]
        results = _prompt_for_parameters(dict(missing_parameters),
                                         fail_on_no_tty=False)
        self.assertTrue(str(list(results.keys())) in param_alpha_order)
Exemplo n.º 2
0
    def test_deployment_prompt_alphabetical_order(self):
        # check that params are prompted for in alphabetical order when the file is loaded with preserve_order=False
        curr_dir = os.path.dirname(os.path.realpath(__file__))
        template_path = os.path.join(curr_dir, 'param-validation-template.json').replace('\\', '\\\\')
        parameters_path = os.path.join(curr_dir, 'param-validation-params.json').replace('\\', '\\\\')
        parameters_with_reference_path = os.path.join(curr_dir, 'param-validation-ref-params.json').replace('\\', '\\\\')

        template = get_file_json(template_path, preserve_order=False)
        template_param_defs = template.get('parameters', {})

        parameter_list = [[parameters_path], [parameters_with_reference_path]]
        result_parameters = _process_parameters(template_param_defs, parameter_list)
        missing_parameters = _find_missing_parameters(result_parameters, template)

        param_alpha_order = ["[u'arrayParam', u'boolParam', u'enumParam', u'objectParam', u'secureParam']",
                             "['arrayParam', 'boolParam', 'enumParam', 'objectParam', 'secureParam']"]
        results = _prompt_for_parameters(dict(missing_parameters), fail_on_no_tty=False)
        self.assertTrue(str(list(results.keys())) in param_alpha_order)