Example #1
0
def generate_valid_param(url, key_list):

    valid_param_list = []
    valid_param_list_all = []

    for key in key_list:

        key_pair = generate_key_pair(url, key)

        valid_param = list()
        new = key_pair[key]
        for item in para_input[new]["valid"]:
            valid_param.append({key: item})
            # valid_param.append({"valid": True})
        valid_param_list_all.append(valid_param)
    if len(key_list) >= 2:
        # print key_list
        # print valid_param_list_all
        pairwise = all_pairs2(valid_param_list_all)

        for i, v in enumerate(pairwise):
            valid_param_list.append(v)

        return valid_param_list
    else:
        return valid_param_list_all
Example #2
0
 def _generate_all_pairs_variable_values(self):
     if len(list(self._machine.variables)) < 2:
         for var in self._machine.variables:
             return [v for v in var.values]
         return [[]]
     return all_pairs2.all_pairs2([v.values for v in self._machine.variables])