diff --git a/src/rougail/convert.py b/src/rougail/convert.py index 940486cc7..3b59af363 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -47,6 +47,7 @@ import logging from pathlib import Path from typing import Optional, Union, get_type_hints, Any, Literal, List, Dict, Iterator, Tuple from itertools import chain +from re import findall from yaml import safe_load from pydantic import ValidationError @@ -124,9 +125,28 @@ class Paths: ) -> Any: suffix = None dynamic_path = None + dynamic_variable_path = None if not path in self._data: for dynamic in self._dynamics: - if path.startswith(dynamic): + if "{{ suffix }}" in dynamic: + regexp = "^" + dynamic.replace('{{ suffix }}', '(.*)') + '.' + finded = findall(regexp, path) + if len(finded) != 1: + continue + splitted_dynamic = dynamic.split('.') + splitted_path = path.split('.') + for idx, s in enumerate(splitted_dynamic): + if '{{ suffix }}' in s: + break + + suffix_path = '.'.join(splitted_path[idx + 1:]) + if suffix_path: + suffix_path = "." + suffix_path + suffix = splitted_path[idx] + suffix_path + dynamic_path = dynamic + dynamic_variable_path = dynamic + suffix_path + break + elif path.startswith(dynamic): subpaths = path[len(dynamic) :].split(".", 1) if ( subpaths[0] @@ -136,15 +156,16 @@ class Paths: suffix = ( dynamic.rsplit(".", 1)[-1] + subpaths[0] + "." + subpaths[1] ) - dynamic_path = dynamic + "." + subpaths[1] + dynamic_path = dynamic + dynamic_variable_path = dynamic + "." + subpaths[1] break - if suffix: - break if suffix is None and not path in self._data: - return None, None - if suffix and dynamic_path: - path = dynamic_path - return self._data[path], suffix + return None, None, None + dynamic = None + if suffix and dynamic_variable_path: + path = dynamic_variable_path + dynamic = self._data[dynamic_path] + return self._data[path], suffix, dynamic def __getitem__( self, diff --git a/src/rougail/object_model.py b/src/rougail/object_model.py index 18ca5bdf6..c6b3d0c96 100644 --- a/src/rougail/object_model.py +++ b/src/rougail/object_model.py @@ -85,7 +85,7 @@ class Calculation(BaseModel): param = param_obj.model_dump() if param.get("type") == "variable": variable_path = self.get_realpath(param["variable"]) - variable, suffix = objectspace.paths.get_with_dynamic(variable_path) + variable, suffix, dynamic = objectspace.paths.get_with_dynamic(variable_path) if not variable: if not param.get("optional"): raise Exception(f"cannot find {variable_path}") @@ -95,6 +95,7 @@ class Calculation(BaseModel): param["variable"] = variable if suffix: param["suffix"] = suffix + param["dynamic"] = dynamic if param.get("type") == "information": if param["variable"]: variable_path = self.get_realpath(param["variable"]) @@ -147,7 +148,7 @@ class JinjaCalculation(Calculation): default["params"] |= self.get_params(objectspace) if params: default["params"] |= params - for sub_variable, suffix, true_path in get_jinja_variable_to_param( + for sub_variable, suffix, true_path, dynamic in get_jinja_variable_to_param( self.jinja, objectspace, variable.xmlfiles, @@ -161,6 +162,7 @@ class JinjaCalculation(Calculation): } if suffix: default["params"][true_path]["suffix"] = suffix + default["params"][true_path]["dynamic"] = dynamic return default def to_function( @@ -230,7 +232,7 @@ class VariableCalculation(Calculation): objectspace, ) -> dict: variable_path = self.get_realpath(self.variable) - variable, suffix = objectspace.paths.get_with_dynamic(variable_path) + variable, suffix, dynamic = objectspace.paths.get_with_dynamic(variable_path) if not variable: raise Exception(f"pffff {variable_path}") if not isinstance(variable, objectspace.variable): @@ -242,6 +244,7 @@ class VariableCalculation(Calculation): } if suffix: param["suffix"] = suffix + param["dynamic"] = dynamic params = {None: [param]} function = "calc_value" help_function = None diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 8fda29351..24d931477 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -393,6 +393,7 @@ class Common: param["variable"], param.get("propertyerror", True), param.get("suffix"), + param.get("dynamic"), ) if param["type"] == "any": if isinstance(param["value"], str): @@ -407,6 +408,7 @@ class Common: param, propertyerror, suffix: Optional[str], + dynamic, ) -> str: """build variable parameters""" if param.path == self.elt.path: @@ -417,7 +419,7 @@ class Common: params = [f"{option_name}"] if suffix is not None: param_type = "ParamDynOption" - family = self.tiramisu.reflector_objects[param.path.rsplit(".", 1)[0]].get( + family = self.tiramisu.reflector_objects[dynamic.path].get( self.calls, self.elt.path ) params.extend([f"'{suffix}'", f"{family}"]) diff --git a/src/rougail/utils.py b/src/rougail/utils.py index a5c16d969..8c6edf6d3 100644 --- a/src/rougail/utils.py +++ b/src/rougail/utils.py @@ -112,8 +112,8 @@ def get_jinja_variable_to_param( variables = list(variables) variables.sort() for variable_path in variables: - variable, suffix = objectspace.paths.get_with_dynamic( + variable, suffix, dynamic = objectspace.paths.get_with_dynamic( get_realpath(variable_path, path_prefix) ) if variable and variable.path in objectspace.variables: - yield variable, suffix, variable_path + yield variable, suffix, variable_path, dynamic diff --git a/tests/dictionaries/00empty/makedict/mandatory.json b/tests/dictionaries/00empty/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/00empty/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/00empty_variable/makedict/mandatory.json b/tests/dictionaries/00empty_variable/makedict/mandatory.json new file mode 100644 index 000000000..46de83cdc --- /dev/null +++ b/tests/dictionaries/00empty_variable/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.empty"] \ No newline at end of file diff --git a/tests/dictionaries/00load_notype/makedict/mandatory.json b/tests/dictionaries/00load_notype/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/00load_notype/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/00load_save/makedict/mandatory.json b/tests/dictionaries/00load_save/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/00load_save/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/00load_subfolder/makedict/mandatory.json b/tests/dictionaries/00load_subfolder/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/00load_subfolder/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_domainname/makedict/mandatory.json b/tests/dictionaries/01base_domainname/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_domainname/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_domainname_params/makedict/mandatory.json b/tests/dictionaries/01base_domainname_params/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_domainname_params/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_float/makedict/mandatory.json b/tests/dictionaries/01base_float/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_float/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_help_quote/makedict/mandatory.json b/tests/dictionaries/01base_help_quote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_help_quote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_multi/makedict/mandatory.json b/tests/dictionaries/01base_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_multi_notuniq/makedict/mandatory.json b/tests/dictionaries/01base_multi_notuniq/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_multi_uniq/makedict/mandatory.json b/tests/dictionaries/01base_multi_uniq/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_doublequote/makedict/mandatory.json b/tests/dictionaries/01base_value_doublequote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_doublequote2/makedict/mandatory.json b/tests/dictionaries/01base_value_doublequote2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_doublequote3/makedict/mandatory.json b/tests/dictionaries/01base_value_doublequote3/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote3/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_multi_doublequote/makedict/mandatory.json b/tests/dictionaries/01base_value_multi_doublequote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_multi_doublequote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_multi_doublequote2/makedict/mandatory.json b/tests/dictionaries/01base_value_multi_doublequote2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_multi_doublequote2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_multi_quote/makedict/mandatory.json b/tests/dictionaries/01base_value_multi_quote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_multi_quote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_value_quote/makedict/mandatory.json b/tests/dictionaries/01base_value_quote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_value_quote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01base_var_name_same_family/makedict/mandatory.json b/tests/dictionaries/01base_var_name_same_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01base_var_name_same_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01boolean_no_mandatory/makedict/mandatory.json b/tests/dictionaries/01boolean_no_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01boolean_no_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01family_description/makedict/mandatory.json b/tests/dictionaries/01family_description/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01family_description/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test/makedict/mandatory.json b/tests/dictionaries/01test/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_boolean/makedict/mandatory.json b/tests/dictionaries/01test_boolean/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_boolean/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_multi/makedict/mandatory.json b/tests/dictionaries/01test_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_multi_none/makedict/mandatory.json b/tests/dictionaries/01test_multi_none/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_multi_none/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_redefine/makedict/mandatory.json b/tests/dictionaries/01test_redefine/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_redefine/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_redefine_base/makedict/mandatory.json b/tests/dictionaries/01test_redefine_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_redefine_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/01test_redefine_remove/makedict/mandatory.json b/tests/dictionaries/01test_redefine_remove/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/01test_redefine_remove/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10autosave_hidden/makedict/mandatory.json b/tests/dictionaries/10autosave_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10autosave_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_base/makedict/mandatory.json b/tests/dictionaries/10check_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_no_param/makedict/mandatory.json b/tests/dictionaries/10check_no_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_no_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_optional/makedict/mandatory.json b/tests/dictionaries/10check_optional/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_optional/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_differ/makedict/mandatory.json b/tests/dictionaries/10check_valid_differ/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_valid_differ/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_differ_add/makedict/mandatory.json b/tests/dictionaries/10check_valid_differ_add/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_valid_differ_add/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_differ_removecheck/makedict/mandatory.json b/tests/dictionaries/10check_valid_differ_removecheck/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_valid_differ_removecheck/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_in_network/makedict/mandatory.json b/tests/dictionaries/10check_valid_in_network/makedict/mandatory.json new file mode 100644 index 000000000..6ce56349d --- /dev/null +++ b/tests/dictionaries/10check_valid_in_network/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.general.adresse_ip_eth0", "rougail.general.adresse_netmask_eth0", "rougail.general.adresse_ip"] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_in_network_cidr/makedict/mandatory.json b/tests/dictionaries/10check_valid_in_network_cidr/makedict/mandatory.json new file mode 100644 index 000000000..6474feb6d --- /dev/null +++ b/tests/dictionaries/10check_valid_in_network_cidr/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.general.adresse_ip_eth0", "rougail.general.adresse_ip"] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_ipnetmask/makedict/mandatory.json b/tests/dictionaries/10check_valid_ipnetmask/makedict/mandatory.json new file mode 100644 index 000000000..8ccfe05e8 --- /dev/null +++ b/tests/dictionaries/10check_valid_ipnetmask/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.general.adresse_ip_eth0", "rougail.general.adresse_netmask_eth0"] \ No newline at end of file diff --git a/tests/dictionaries/10check_valid_jinja/makedict/mandatory.json b/tests/dictionaries/10check_valid_jinja/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10check_valid_jinja/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10disabled_with_variable/makedict/mandatory.json b/tests/dictionaries/10disabled_with_variable/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10disabled_with_variable/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10disabled_with_variable2/makedict/mandatory.json b/tests/dictionaries/10disabled_with_variable2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10disabled_with_variable2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10fill/makedict/mandatory.json b/tests/dictionaries/10fill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10fill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10fill_optional/makedict/mandatory.json b/tests/dictionaries/10fill_optional/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10fill_optional/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10fill_quote/makedict/mandatory.json b/tests/dictionaries/10fill_quote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10fill_quote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10fill_target_information/makedict/mandatory.json b/tests/dictionaries/10fill_target_information/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10fill_target_information/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10fill_target_optional/makedict/mandatory.json b/tests/dictionaries/10fill_target_optional/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10fill_target_optional/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10frozenifin_unknown_valid_enum_number/makedict/mandatory.json b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_append/makedict/mandatory.json b/tests/dictionaries/10leadership_append/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_append/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_append_hidden/makedict/mandatory.json b/tests/dictionaries/10leadership_append_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_append_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_append_name/makedict/mandatory.json b/tests/dictionaries/10leadership_append_name/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_append_name/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_auto/makedict/mandatory.json b/tests/dictionaries/10leadership_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_auto_index/makedict/mandatory.json b/tests/dictionaries/10leadership_auto_index/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_auto_index/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_auto_index_param/makedict/mandatory.json b/tests/dictionaries/10leadership_auto_index_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_auto_index_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_autoleader/makedict/mandatory.json b/tests/dictionaries/10leadership_autoleader/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json b/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_autosaveexpert/makedict/mandatory.json b/tests/dictionaries/10leadership_autosaveexpert/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_autosaveexpert/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_empty/makedict/mandatory.json b/tests/dictionaries/10leadership_empty/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_empty/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_hidden/makedict/mandatory.json b/tests/dictionaries/10leadership_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_leader_hidden/makedict/mandatory.json b/tests/dictionaries/10leadership_leader_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in/makedict/mandatory.json b/tests/dictionaries/10leadership_leader_hidden_if_in/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden_if_in/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in_name/makedict/mandatory.json b/tests/dictionaries/10leadership_leader_hidden_if_in_name/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden_if_in_name/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_leadermandatory/makedict/mandatory.json b/tests/dictionaries/10leadership_leadermandatory/makedict/mandatory.json new file mode 100644 index 000000000..e402e2ebd --- /dev/null +++ b/tests/dictionaries/10leadership_leadermandatory/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.general.leader.leader"] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_mandatoryfollower/makedict/mandatory.json b/tests/dictionaries/10leadership_mandatoryfollower/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/mandatory.json b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10leadership_multi/makedict/mandatory.json b/tests/dictionaries/10leadership_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10leadership_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_fill/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_fill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_fill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_list_optional/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_list_optional/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_list_optional/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_none/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_none/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_none/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_twice/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_twice/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_twice/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_variable/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_variable/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_in_variable2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback_force/makedict/mandatory.json b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabledifin_fallback/makedict/mandatory.json b/tests/dictionaries/10load_disabledifin_fallback/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_fallback/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabledifin_fallback_force/makedict/mandatory.json b/tests/dictionaries/10load_disabledifin_fallback_force/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_fallback_force/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_disabledifin_whithouttype/makedict/mandatory.json b/tests/dictionaries/10load_disabledifin_whithouttype/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_whithouttype/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_frozenifin/makedict/mandatory.json b/tests/dictionaries/10load_frozenifin/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_frozenifin/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_frozenifin_auto/makedict/mandatory.json b/tests/dictionaries/10load_frozenifin_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_frozenifin_multiparam/makedict/mandatory.json b/tests/dictionaries/10load_frozenifin_multiparam/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_multiparam/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_frozenifin_variable/makedict/mandatory.json b/tests/dictionaries/10load_frozenifin_variable/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_variable/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_frozenifnotin/makedict/mandatory.json b/tests/dictionaries/10load_frozenifnotin/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_frozenifnotin/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_hidden_if_empty_family/makedict/mandatory.json b/tests/dictionaries/10load_hidden_if_empty_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_empty_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_hidden_if_family/makedict/mandatory.json b/tests/dictionaries/10load_hidden_if_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_hidden_if_family2/makedict/mandatory.json b/tests/dictionaries/10load_hidden_if_family2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_family2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_hidden_if_family3/makedict/mandatory.json b/tests/dictionaries/10load_hidden_if_family3/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_family3/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership/makedict/mandatory.json b/tests/dictionaries/10load_leadership/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_default_multi/makedict/mandatory.json b/tests/dictionaries/10load_leadership_default_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_default_submulti/makedict/mandatory.json b/tests/dictionaries/10load_leadership_default_submulti/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_defaultmulti_leader/makedict/mandatory.json b/tests/dictionaries/10load_leadership_defaultmulti_leader/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_defaultmulti_leader/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_description/makedict/mandatory.json b/tests/dictionaries/10load_leadership_description/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_description/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_name/makedict/mandatory.json b/tests/dictionaries/10load_leadership_name/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_name/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_leadership_submulti/makedict/mandatory.json b/tests/dictionaries/10load_leadership_submulti/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_leadership_submulti/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_mandatoryifin/makedict/mandatory.json b/tests/dictionaries/10load_mandatoryifin/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_mandatoryifin/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10load_multivalue/makedict/mandatory.json b/tests/dictionaries/10load_multivalue/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10load_multivalue/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_accent/makedict/mandatory.json b/tests/dictionaries/10valid_enum_accent/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_accent/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_base/makedict/mandatory.json b/tests/dictionaries/10valid_enum_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_base_no_mandatory/makedict/mandatory.json b/tests/dictionaries/10valid_enum_base_no_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_base_no_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_base_redefine/makedict/mandatory.json b/tests/dictionaries/10valid_enum_base_redefine/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_base_redefine/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_leader/makedict/mandatory.json b/tests/dictionaries/10valid_enum_leader/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_leader/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_mandatory/makedict/mandatory.json b/tests/dictionaries/10valid_enum_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_multi/makedict/mandatory.json b/tests/dictionaries/10valid_enum_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_none/makedict/mandatory.json b/tests/dictionaries/10valid_enum_none/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_none/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_number/makedict/mandatory.json b/tests/dictionaries/10valid_enum_number/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_number/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_numberdefault/makedict/mandatory.json b/tests/dictionaries/10valid_enum_numberdefault/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_numberdefault/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_param_empty/makedict/mandatory.json b/tests/dictionaries/10valid_enum_param_empty/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_param_empty/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_param_empty2/makedict/mandatory.json b/tests/dictionaries/10valid_enum_param_empty2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_param_empty2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_quote/makedict/mandatory.json b/tests/dictionaries/10valid_enum_quote/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_quote/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/10valid_enum_value/makedict/mandatory.json b/tests/dictionaries/10valid_enum_value/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/10valid_enum_value/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11autosave_hidden_frozenifin/makedict/mandatory.json b/tests/dictionaries/11autosave_hidden_frozenifin/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11autosave_hidden_frozenifin/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabled_if_in_filelist_same_name/makedict/mandatory.json b/tests/dictionaries/11disabled_if_in_filelist_same_name/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_same_name/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/mandatory.json b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/mandatory.json b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/mandatory.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/mandatory.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11fill_multi_calc_val/makedict/mandatory.json b/tests/dictionaries/11fill_multi_calc_val/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11fill_multi_calc_val/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11fill_multi_calc_val_multi/makedict/mandatory.json b/tests/dictionaries/11fill_multi_calc_val_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11fill_multi_calc_val_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11valid_enum_function/makedict/mandatory.json b/tests/dictionaries/11valid_enum_function/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11valid_enum_function/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/11valid_enum_variable/makedict/mandatory.json b/tests/dictionaries/11valid_enum_variable/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/11valid_enum_variable/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_base/makedict/mandatory.json b/tests/dictionaries/12auto_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_func_variable/makedict/mandatory.json b/tests/dictionaries/12auto_func_variable/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_func_variable/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_jinja_base/makedict/mandatory.json b/tests/dictionaries/12auto_jinja_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_jinja_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_jinja_if/makedict/mandatory.json b/tests/dictionaries/12auto_jinja_if/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_jinja_if/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_jinja_if_bool/makedict/mandatory.json b/tests/dictionaries/12auto_jinja_if_bool/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_jinja_if_bool/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_jinja_if_int/makedict/mandatory.json b/tests/dictionaries/12auto_jinja_if_int/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_jinja_if_int/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_jinja_set/makedict/mandatory.json b/tests/dictionaries/12auto_jinja_set/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_jinja_set/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/12auto_withoutparam/makedict/mandatory.json b/tests/dictionaries/12auto_withoutparam/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/12auto_withoutparam/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/13fill_information/makedict/mandatory.json b/tests/dictionaries/13fill_information/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/13fill_information/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/13fill_information_multi/makedict/mandatory.json b/tests/dictionaries/13fill_information_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/13fill_information_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/13fill_option/makedict/mandatory.json b/tests/dictionaries/13fill_option/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/13fill_option/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/13fill_option_information/makedict/mandatory.json b/tests/dictionaries/13fill_option_information/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/13fill_option_information/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/13fill_option_information_param/makedict/mandatory.json b/tests/dictionaries/13fill_option_information_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/13fill_option_information_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15fill_autosave/makedict/mandatory.json b/tests/dictionaries/15fill_autosave/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15fill_autosave/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15fill_base/makedict/mandatory.json b/tests/dictionaries/15fill_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15fill_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15fill_mandatory/makedict/mandatory.json b/tests/dictionaries/15fill_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15fill_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15fill_number/makedict/mandatory.json b/tests/dictionaries/15fill_number/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15fill_number/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15fill_only_optional/makedict/mandatory.json b/tests/dictionaries/15fill_only_optional/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15fill_only_optional/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15load_autosave/makedict/mandatory.json b/tests/dictionaries/15load_autosave/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15load_autosave/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/15load_autosaveexpert/makedict/mandatory.json b/tests/dictionaries/15load_autosaveexpert/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/15load_autosaveexpert/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_append/makedict/mandatory.json b/tests/dictionaries/20family_append/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_append/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_disabled/makedict/mandatory.json b/tests/dictionaries/20family_disabled/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_disabled/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic/makedict/mandatory.json b/tests/dictionaries/20family_dynamic/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_calc/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_calc/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_calc2/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_calc2/dictionaries/rougail/00-base.yml index 470d258b4..6d0ac3ce9 100644 --- a/tests/dictionaries/20family_dynamic_calc2/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/20family_dynamic_calc2/dictionaries/rougail/00-base.yml @@ -1,30 +1,24 @@ +--- version: '1.0' general: varname: - type: string - description: No change multi: true default: - - val1 - - val2 + - val1 + - val2 dyn: type: dynamic variable: rougail.general.varname vardyn: type: string - description: No change default: val hidden: type: jinja - jinja: '{% if rougail.new.newvar == "non" %} - + jinja: | + {% if rougail.new.newvar == "non" %} newvar is non - {% endif %} - - ' new: newvar: type: string - description: No change mandatory: false diff --git a/tests/dictionaries/20family_dynamic_calc2/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_calc2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py index 10285c015..c2ef3d754 100644 --- a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py @@ -69,10 +69,10 @@ dict_env['hidden_rougail.dyn'] = "{% if rougail.new.newvar == \"non\" %}\nnewvar ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) ENV.filters = func ENV.compile_templates('jinja_caches', zip=None) -option_3 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) -option_7 = StrOption(name="newvar", doc="No change", properties=frozenset({"standard"})) -option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_7)}), help_function=func['jinja_to_property_help'])})) +option_7 = StrOption(name="newvar", doc="newvar", properties=frozenset({"standard"})) +option_5 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_7)}), help_function=func['jinja_to_property_help'])})) optiondescription_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden")), kwargs={'__internal_jinja': ParamValue("hidden_rougail.dyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_7)}), help_function=func['jinja_to_property_help'])})) optiondescription_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2, optiondescription_4, optiondescription_6], properties=frozenset({"standard"})) diff --git a/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py index 39711cf09..0d9f1e134 100644 --- a/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py @@ -71,18 +71,18 @@ dict_env['hidden_2.rougail.dyn'] = "{% if rougail.new.newvar == \"non\" %}\nnewv ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) ENV.filters = func ENV.compile_templates('jinja_caches', zip=None) -option_4 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_4 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) -option_8 = StrOption(name="newvar", doc="No change", properties=frozenset({"standard"})) -option_6 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_1.rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_8)}), help_function=func['jinja_to_property_help'])})) +option_8 = StrOption(name="newvar", doc="newvar", properties=frozenset({"standard"})) +option_6 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_1.rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_8)}), help_function=func['jinja_to_property_help'])})) optiondescription_5 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden")), kwargs={'__internal_jinja': ParamValue("hidden_1.rougail.dyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_8)}), help_function=func['jinja_to_property_help'])})) optiondescription_7 = OptionDescription(name="new", doc="new", children=[option_8], properties=frozenset({"standard"})) optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3, optiondescription_5, optiondescription_7], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) -option_12 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_12 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_11 = OptionDescription(name="general", doc="general", children=[option_12], properties=frozenset({"standard"})) -option_16 = StrOption(name="newvar", doc="No change", properties=frozenset({"standard"})) -option_14 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_2.rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_16)}), help_function=func['jinja_to_property_help'])})) +option_16 = StrOption(name="newvar", doc="newvar", properties=frozenset({"standard"})) +option_14 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_2.rougail.dyn.vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_16)}), help_function=func['jinja_to_property_help'])})) optiondescription_13 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_12, notraisepropertyerror=True)))), children=[option_14], properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden")), kwargs={'__internal_jinja': ParamValue("hidden_2.rougail.dyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.new.newvar': ParamOption(option_16)}), help_function=func['jinja_to_property_help'])})) optiondescription_15 = OptionDescription(name="new", doc="new", children=[option_16], properties=frozenset({"standard"})) optiondescription_10 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_11, optiondescription_13, optiondescription_15], properties=frozenset({"standard"})) diff --git a/tests/dictionaries/20family_dynamic_calc_suffix/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_calc_suffix/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc_suffix/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_calc_suffix_param/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_calc_suffix_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc_suffix_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_description/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_description/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_description/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_jinja_fill/dictionaries/rougail/00-base.yml index 6c71433ab..db9d13a55 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/20family_dynamic_jinja_fill/dictionaries/rougail/00-base.yml @@ -3,7 +3,6 @@ version: '1.0' general: varname: type: string - description: No change multi: true default: - val1 @@ -13,12 +12,10 @@ dyn: variable: rougail.general.varname vardyn: type: string - description: No change default: val new: newvar: type: string - description: No change mandatory: false default: type: jinja diff --git a/tests/dictionaries/20family_dynamic_jinja_fill/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_jinja_fill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/base.py index 34a7e36c6..8298c1479 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/base.py @@ -68,11 +68,11 @@ dict_env['default_rougail.new.newvar'] = "{{ rougail.dynval1.vardyn }}" ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) ENV.filters = func ENV.compile_templates('jinja_caches', zip=None) -option_3 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) -option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "standard"})) +option_5 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) optiondescription_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"standard"})) -option_7 = StrOption(name="newvar", doc="No change", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_5, 'dynval1.vardyn', optiondescription_4)})), properties=frozenset({"standard"})) +option_7 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_5, 'dynval1.vardyn', optiondescription_4)})), properties=frozenset({"standard"})) optiondescription_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2, optiondescription_4, optiondescription_6], properties=frozenset({"standard"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/multi.py index 481630117..a7b853ab4 100644 --- a/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/multi.py +++ b/tests/dictionaries/20family_dynamic_jinja_fill/tiramisu/multi.py @@ -69,19 +69,19 @@ dict_env['default_2.rougail.new.newvar'] = "{{ rougail.dynval1.vardyn }}" ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) ENV.filters = func ENV.compile_templates('jinja_caches', zip=None) -option_4 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_4 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) -option_6 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "standard"})) +option_6 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) optiondescription_5 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"standard"})) -option_8 = StrOption(name="newvar", doc="No change", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_6, 'dynval1.vardyn', optiondescription_5)})), properties=frozenset({"standard"})) +option_8 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_6, 'dynval1.vardyn', optiondescription_5)})), properties=frozenset({"standard"})) optiondescription_7 = OptionDescription(name="new", doc="new", children=[option_8], properties=frozenset({"standard"})) optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3, optiondescription_5, optiondescription_7], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) -option_12 = StrOption(name="varname", doc="No change", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +option_12 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) optiondescription_11 = OptionDescription(name="general", doc="general", children=[option_12], properties=frozenset({"standard"})) -option_14 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "standard"})) +option_14 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) optiondescription_13 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_12, notraisepropertyerror=True)))), children=[option_14], properties=frozenset({"standard"})) -option_16 = StrOption(name="newvar", doc="No change", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_14, 'dynval1.vardyn', optiondescription_13)})), properties=frozenset({"standard"})) +option_16 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.vardyn': ParamDynOption(option_14, 'dynval1.vardyn', optiondescription_13)})), properties=frozenset({"standard"})) optiondescription_15 = OptionDescription(name="new", doc="new", children=[option_16], properties=frozenset({"standard"})) optiondescription_10 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_11, optiondescription_13, optiondescription_15], properties=frozenset({"standard"})) optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"})) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/__init__.py b/tests/dictionaries/20family_dynamic_jinja_fill2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_jinja_fill2/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..f9e68d014 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/dictionaries/rougail/00-base.yml @@ -0,0 +1,22 @@ +--- +version: '1.0' +general: + varname: + type: string + multi: true + default: + - val1 + - val2 +"{{ suffix }}_dyn": + type: dynamic + variable: rougail.general.varname + vardyn: + type: string + default: val +new: + newvar: + type: string + mandatory: false + default: + type: jinja + jinja: '{{ rougail.val1_dyn.vardyn }}' diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/after.json b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/after.json new file mode 100644 index 000000000..36316dabd --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/after.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.val1_dyn.vardyn": { + "owner": "default", + "value": "val" + }, + "rougail.val2_dyn.vardyn": { + "owner": "default", + "value": "val" + }, + "rougail.new.newvar": { + "owner": "default", + "value": "val" + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/base.json b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/base.json new file mode 100644 index 000000000..492b99263 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/base.json @@ -0,0 +1,9 @@ +{ + "rougail.general.varname": [ + "val1", + "val2" + ], + "rougail.val1_dyn.vardyn": "val", + "rougail.val2_dyn.vardyn": "val", + "rougail.new.newvar": "val" +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/before.json b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/before.json new file mode 100644 index 000000000..36316dabd --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/before.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.val1_dyn.vardyn": { + "owner": "default", + "value": "val" + }, + "rougail.val2_dyn.vardyn": { + "owner": "default", + "value": "val" + }, + "rougail.new.newvar": { + "owner": "default", + "value": "val" + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py new file mode 100644 index 000000000..b448f8944 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/base.py @@ -0,0 +1,78 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_rougail.new.newvar'] = "{{ rougail.val1_dyn.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) +option_5 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) +optiondescription_4 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"standard"})) +option_7 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.val1_dyn.vardyn': ParamDynOption(option_5, 'val1_dyn.vardyn', optiondescription_4)})), properties=frozenset({"standard"})) +optiondescription_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2, optiondescription_4, optiondescription_6], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py new file mode 100644 index 000000000..4de8a30ea --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill2/tiramisu/multi.py @@ -0,0 +1,88 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_1.rougail.new.newvar'] = "{{ rougail.val1_dyn.vardyn }}" +dict_env['default_2.rougail.new.newvar'] = "{{ rougail.val1_dyn.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_4 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) +option_6 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) +optiondescription_5 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"standard"})) +option_8 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.val1_dyn.vardyn': ParamDynOption(option_6, 'val1_dyn.vardyn', optiondescription_5)})), properties=frozenset({"standard"})) +optiondescription_7 = OptionDescription(name="new", doc="new", children=[option_8], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3, optiondescription_5, optiondescription_7], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) +option_12 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_11 = OptionDescription(name="general", doc="general", children=[option_12], properties=frozenset({"standard"})) +option_14 = StrOption(name="vardyn", doc="vardyn", default="val", properties=frozenset({"mandatory", "standard"})) +optiondescription_13 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_12, notraisepropertyerror=True)))), children=[option_14], properties=frozenset({"standard"})) +option_16 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.val1_dyn.vardyn': ParamDynOption(option_14, 'val1_dyn.vardyn', optiondescription_13)})), properties=frozenset({"standard"})) +optiondescription_15 = OptionDescription(name="new", doc="new", children=[option_16], properties=frozenset({"standard"})) +optiondescription_10 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_11, optiondescription_13, optiondescription_15], properties=frozenset({"standard"})) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/__init__.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..ccb2b9ca6 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/dictionaries/rougail/00-base.yml @@ -0,0 +1,21 @@ +--- +version: '1.0' +general: + varname: + type: string + multi: true + default: + - val1 + - val2 +dyn: + type: dynamic + variable: rougail.general.varname + grp: + vardyn: +new: + newvar: + type: string + mandatory: false + default: + type: jinja + jinja: '{{ rougail.dynval1.grp.vardyn }}' diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/after.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/after.json new file mode 100644 index 000000000..14886d47c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/after.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.dynval2.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.new.newvar": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/base.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/base.json new file mode 100644 index 000000000..1fd04a71c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/base.json @@ -0,0 +1,9 @@ +{ + "rougail.general.varname": [ + "val1", + "val2" + ], + "rougail.dynval1.grp.vardyn": null, + "rougail.dynval2.grp.vardyn": null, + "rougail.new.newvar": null +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/before.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/before.json new file mode 100644 index 000000000..14886d47c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/before.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.dynval2.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.new.newvar": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/mandatory.json new file mode 100644 index 000000000..694f0ed89 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.dynval1.grp.vardyn", "rougail.dynval2.grp.vardyn"] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py new file mode 100644 index 000000000..085c829ac --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/base.py @@ -0,0 +1,79 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) +option_6 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_5 = OptionDescription(name="grp", doc="grp", children=[option_6], properties=frozenset({"basic"})) +optiondescription_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[optiondescription_5], properties=frozenset({"basic"})) +option_8 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_6, 'dynval1.grp.vardyn', optiondescription_4)})), properties=frozenset({"standard"})) +optiondescription_7 = OptionDescription(name="new", doc="new", children=[option_8], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2, optiondescription_4, optiondescription_7], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py new file mode 100644 index 000000000..f6ee48f7b --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group/tiramisu/multi.py @@ -0,0 +1,90 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_1.rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +dict_env['default_2.rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_4 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) +option_7 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_6 = OptionDescription(name="grp", doc="grp", children=[option_7], properties=frozenset({"basic"})) +optiondescription_5 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[optiondescription_6], properties=frozenset({"basic"})) +option_9 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_7, 'dynval1.grp.vardyn', optiondescription_5)})), properties=frozenset({"standard"})) +optiondescription_8 = OptionDescription(name="new", doc="new", children=[option_9], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3, optiondescription_5, optiondescription_8], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"})) +option_13 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="general", doc="general", children=[option_13], properties=frozenset({"standard"})) +option_16 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_15 = OptionDescription(name="grp", doc="grp", children=[option_16], properties=frozenset({"basic"})) +optiondescription_14 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_13, notraisepropertyerror=True)))), children=[optiondescription_15], properties=frozenset({"basic"})) +option_18 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_16, 'dynval1.grp.vardyn', optiondescription_14)})), properties=frozenset({"standard"})) +optiondescription_17 = OptionDescription(name="new", doc="new", children=[option_18], properties=frozenset({"standard"})) +optiondescription_11 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_12, optiondescription_14, optiondescription_17], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="2", doc="2", children=[optiondescription_11], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_10]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/__init__.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/dictionaries/rougail/00-base.yml b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..b16716cea --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/dictionaries/rougail/00-base.yml @@ -0,0 +1,21 @@ +--- +version: '1.0' +general: + varname: + type: string + multi: true + default: + - val1 + - val2 +"dyn{{ suffix }}": + type: dynamic + variable: rougail.general.varname + grp: + vardyn: +new: + newvar: + type: string + mandatory: false + default: + type: jinja + jinja: '{{ rougail.dynval1.grp.vardyn }}' diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/after.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/after.json new file mode 100644 index 000000000..14886d47c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/after.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.dynval2.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.new.newvar": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/base.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/base.json new file mode 100644 index 000000000..1fd04a71c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/base.json @@ -0,0 +1,9 @@ +{ + "rougail.general.varname": [ + "val1", + "val2" + ], + "rougail.dynval1.grp.vardyn": null, + "rougail.dynval2.grp.vardyn": null, + "rougail.new.newvar": null +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/before.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/before.json new file mode 100644 index 000000000..14886d47c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/before.json @@ -0,0 +1,21 @@ +{ + "rougail.general.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.dynval2.grp.vardyn": { + "owner": "default", + "value": null + }, + "rougail.new.newvar": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/mandatory.json new file mode 100644 index 000000000..694f0ed89 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.dynval1.grp.vardyn", "rougail.dynval2.grp.vardyn"] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py new file mode 100644 index 000000000..c38e2b46c --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/base.py @@ -0,0 +1,79 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"})) +option_6 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_5 = OptionDescription(name="grp", doc="grp", children=[option_6], properties=frozenset({"basic"})) +optiondescription_4 = ConvertDynOptionDescription(name="dyn{{ suffix }}", doc="dyn{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[optiondescription_5], properties=frozenset({"basic"})) +option_8 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_6, 'dynval1.grp.vardyn', optiondescription_4)})), properties=frozenset({"standard"})) +optiondescription_7 = OptionDescription(name="new", doc="new", children=[option_8], properties=frozenset({"standard"})) +optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2, optiondescription_4, optiondescription_7], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py new file mode 100644 index 000000000..9c3038abf --- /dev/null +++ b/tests/dictionaries/20family_dynamic_jinja_fill_sub_group_2/tiramisu/multi.py @@ -0,0 +1,90 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +from importlib.machinery import SourceFileLoader as _SourceFileLoader +from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec +global func +func = {'calc_value': calc_value} + +def _load_functions(path): + global _SourceFileLoader, _spec_from_loader, _module_from_spec, func + loader = _SourceFileLoader('func', path) + spec = _spec_from_loader(loader.name, loader) + func_ = _module_from_spec(spec) + loader.exec_module(func_) + for function in dir(func_): + if function.startswith('_'): + continue + func[function] = getattr(func_, function) +_load_functions('tests/dictionaries/../eosfunc/test.py') +from jinja2 import StrictUndefined, DictLoader +from jinja2.sandbox import SandboxedEnvironment +from rougail.annotator.variable import CONVERT_OPTION +from tiramisu.error import ValueWarning +def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs): + global ENV, CONVERT_OPTION + kw = {} + for key, value in kwargs.items(): + if '.' in key: + c_kw = kw + path, var = key.rsplit('.', 1) + for subkey in path.split('.'): + c_kw = c_kw.setdefault(subkey, {}) + c_kw[var] = value + else: + kw[key] = value + values = ENV.get_template(__internal_jinja).render(kw, **func).strip() + convert = CONVERT_OPTION[__internal_type].get('func', str) + if __internal_multi: + return [convert(val) for val in values.split()] + values = convert(values) + return values if values != '' and values != 'None' else None +def variable_to_property(prop, value): + return prop if value else None +def jinja_to_property(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return func['variable_to_property'](prop, value is not None) +def jinja_to_property_help(prop, **kwargs): + value = func['jinja_to_function'](**kwargs) + return (prop, f'"{prop}" ({value})') +def valid_with_jinja(warnings_only=False, **kwargs): + global ValueWarning + value = func['jinja_to_function'](**kwargs) + if value: + if warnings_only: + raise ValueWarning(value) + else: + raise ValueError(value) +func['jinja_to_function'] = jinja_to_function +func['jinja_to_property'] = jinja_to_property +func['jinja_to_property_help'] = jinja_to_property_help +func['variable_to_property'] = variable_to_property +func['valid_with_jinja'] = valid_with_jinja +dict_env = {} +from rougail.tiramisu import ConvertDynOptionDescription +dict_env['default_1.rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +dict_env['default_2.rougail.new.newvar'] = "{{ rougail.dynval1.grp.vardyn }}" +ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) +ENV.filters = func +ENV.compile_templates('jinja_caches', zip=None) +option_4 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"})) +option_7 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_6 = OptionDescription(name="grp", doc="grp", children=[option_7], properties=frozenset({"basic"})) +optiondescription_5 = ConvertDynOptionDescription(name="dyn{{ suffix }}", doc="dyn{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[optiondescription_6], properties=frozenset({"basic"})) +option_9 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_7, 'dynval1.grp.vardyn', optiondescription_5)})), properties=frozenset({"standard"})) +optiondescription_8 = OptionDescription(name="new", doc="new", children=[option_9], properties=frozenset({"standard"})) +optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3, optiondescription_5, optiondescription_8], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"})) +option_13 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) +optiondescription_12 = OptionDescription(name="general", doc="general", children=[option_13], properties=frozenset({"standard"})) +option_16 = StrOption(name="vardyn", doc="vardyn", properties=frozenset({"basic", "mandatory"})) +optiondescription_15 = OptionDescription(name="grp", doc="grp", children=[option_16], properties=frozenset({"basic"})) +optiondescription_14 = ConvertDynOptionDescription(name="dyn{{ suffix }}", doc="dyn{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_13, notraisepropertyerror=True)))), children=[optiondescription_15], properties=frozenset({"basic"})) +option_18 = StrOption(name="newvar", doc="newvar", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.new.newvar"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'rougail.dynval1.grp.vardyn': ParamDynOption(option_16, 'dynval1.grp.vardyn', optiondescription_14)})), properties=frozenset({"standard"})) +optiondescription_17 = OptionDescription(name="new", doc="new", children=[option_18], properties=frozenset({"standard"})) +optiondescription_11 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_12, optiondescription_14, optiondescription_17], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="2", doc="2", children=[optiondescription_11], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_10]) diff --git a/tests/dictionaries/20family_dynamic_leadership/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_leadership/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_leadership/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_number/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_number/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_number/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_variable_outside/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_variable_outside/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_variable_outside/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_dynamic_variable_outside_suffix/makedict/mandatory.json b/tests/dictionaries/20family_dynamic_variable_outside_suffix/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_dynamic_variable_outside_suffix/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_empty/makedict/mandatory.json b/tests/dictionaries/20family_empty/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_empty/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_hidden/makedict/mandatory.json b/tests/dictionaries/20family_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_mode/makedict/mandatory.json b/tests/dictionaries/20family_mode/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_mode/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/20family_modeleadership/makedict/mandatory.json b/tests/dictionaries/20family_modeleadership/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/20family_modeleadership/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/21family_empty/makedict/mandatory.json b/tests/dictionaries/21family_empty/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/21family_empty/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/21family_empty_sub/makedict/mandatory.json b/tests/dictionaries/21family_empty_sub/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/30mandatory_withoutvalue/makedict/mandatory.json b/tests/dictionaries/30mandatory_withoutvalue/makedict/mandatory.json new file mode 100644 index 000000000..89fb354f2 --- /dev/null +++ b/tests/dictionaries/30mandatory_withoutvalue/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.general.mode_conteneur_actif"] \ No newline at end of file diff --git a/tests/dictionaries/30mandatory_withoutvaluecalc/makedict/mandatory.json b/tests/dictionaries/30mandatory_withoutvaluecalc/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/30mandatory_withoutvaluecalc/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/30mandatory_withvalue/makedict/mandatory.json b/tests/dictionaries/30mandatory_withvalue/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/30mandatory_withvalue/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/30mandatory_withvaluecalc/makedict/mandatory.json b/tests/dictionaries/30mandatory_withvaluecalc/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/30mandatory_withvaluecalc/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40condition_base/makedict/mandatory.json b/tests/dictionaries/40condition_base/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40condition_base/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40condition_base_add/makedict/mandatory.json b/tests/dictionaries/40condition_base_add/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40condition_base_add/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40empty_param/makedict/mandatory.json b/tests/dictionaries/40empty_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40empty_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40empty_param2/makedict/mandatory.json b/tests/dictionaries/40empty_param2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40empty_param2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_leadership/makedict/mandatory.json b/tests/dictionaries/40ifin_leadership/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_leadership/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_leadershipauto/makedict/mandatory.json b/tests/dictionaries/40ifin_leadershipauto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_leadershipauto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/mandatory.json b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_multi/makedict/mandatory.json b/tests/dictionaries/40ifin_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_multi2/makedict/mandatory.json b/tests/dictionaries/40ifin_multi2/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_multi2/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40ifin_validenum/makedict/mandatory.json b/tests/dictionaries/40ifin_validenum/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40ifin_validenum/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/40space_param/makedict/mandatory.json b/tests/dictionaries/40space_param/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/40space_param/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45extra_without_family/makedict/mandatory.json b/tests/dictionaries/45extra_without_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45extra_without_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45multi_family/makedict/mandatory.json b/tests/dictionaries/45multi_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45multi_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45multi_family_basic/makedict/mandatory.json b/tests/dictionaries/45multi_family_basic/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45multi_family_basic/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45multi_family_expert/makedict/mandatory.json b/tests/dictionaries/45multi_family_expert/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45multi_family_expert/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45multi_family_order/makedict/mandatory.json b/tests/dictionaries/45multi_family_order/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45multi_family_order/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/45without_family/makedict/mandatory.json b/tests/dictionaries/45without_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/45without_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/50exists_exists/makedict/mandatory.json b/tests/dictionaries/50exists_exists/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/50exists_exists/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/50redefine_description/makedict/mandatory.json b/tests/dictionaries/50redefine_description/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/50redefine_description/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51exists_nonexists/makedict/mandatory.json b/tests/dictionaries/51exists_nonexists/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51exists_nonexists/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51exists_redefine/makedict/mandatory.json b/tests/dictionaries/51exists_redefine/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51exists_redefine/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_auto/makedict/mandatory.json b/tests/dictionaries/51redefine_auto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_auto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_autofill/makedict/mandatory.json b/tests/dictionaries/51redefine_autofill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_autofill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_family/makedict/mandatory.json b/tests/dictionaries/51redefine_family/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_family/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_fill/makedict/mandatory.json b/tests/dictionaries/51redefine_fill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_fill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_fillauto/makedict/mandatory.json b/tests/dictionaries/51redefine_fillauto/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_fillauto/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_help/makedict/mandatory.json b/tests/dictionaries/51redefine_help/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_help/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_hidden/makedict/mandatory.json b/tests/dictionaries/51redefine_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_hidden_inverse/makedict/mandatory.json b/tests/dictionaries/51redefine_hidden_inverse/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_hidden_inverse/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_multi/makedict/mandatory.json b/tests/dictionaries/51redefine_multi/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_multi/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_remove_condition/makedict/mandatory.json b/tests/dictionaries/51redefine_remove_condition/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_remove_condition/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_validenum/makedict/mandatory.json b/tests/dictionaries/51redefine_validenum/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_validenum/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_value/makedict/mandatory.json b/tests/dictionaries/51redefine_value/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_value/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51redefine_without_hidden/makedict/mandatory.json b/tests/dictionaries/51redefine_without_hidden/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51redefine_without_hidden/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/51remove_fill/makedict/mandatory.json b/tests/dictionaries/51remove_fill/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/51remove_fill/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/52exists_redefine/makedict/mandatory.json b/tests/dictionaries/52exists_redefine/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/52exists_redefine/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60action_external/makedict/mandatory.json b/tests/dictionaries/60action_external/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60action_external/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_basic/makedict/mandatory.json b/tests/dictionaries/60extra_basic/makedict/mandatory.json new file mode 100644 index 000000000..ac1181c0a --- /dev/null +++ b/tests/dictionaries/60extra_basic/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_externalspacecondition/makedict/mandatory.json b/tests/dictionaries/60extra_externalspacecondition/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_externalspacecondition/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_help/makedict/mandatory.json b/tests/dictionaries/60extra_help/makedict/mandatory.json new file mode 100644 index 000000000..ac1181c0a --- /dev/null +++ b/tests/dictionaries/60extra_help/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_leadership/makedict/mandatory.json b/tests/dictionaries/60extra_leadership/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_leadership/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_leadership_name/makedict/mandatory.json b/tests/dictionaries/60extra_leadership_name/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_leadership_name/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_leadership_name_item/makedict/mandatory.json b/tests/dictionaries/60extra_leadership_name_item/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_leadership_name_item/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_leadership_valid_enum/makedict/mandatory.json b/tests/dictionaries/60extra_leadership_valid_enum/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_leadership_valid_enum/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_load/makedict/mandatory.json b/tests/dictionaries/60extra_load/makedict/mandatory.json new file mode 100644 index 000000000..ac1181c0a --- /dev/null +++ b/tests/dictionaries/60extra_load/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_mandatory/makedict/mandatory.json b/tests/dictionaries/60extra_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..09fbf4b17 --- /dev/null +++ b/tests/dictionaries/60extra_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day", "extra.ejabberd.var1"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_name_family/makedict/mandatory.json b/tests/dictionaries/60extra_name_family/makedict/mandatory.json new file mode 100644 index 000000000..ac1181c0a --- /dev/null +++ b/tests/dictionaries/60extra_name_family/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_no_condition/makedict/mandatory.json b/tests/dictionaries/60extra_no_condition/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_no_condition/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60extra_redefine/makedict/mandatory.json b/tests/dictionaries/60extra_redefine/makedict/mandatory.json new file mode 100644 index 000000000..ac1181c0a --- /dev/null +++ b/tests/dictionaries/60extra_redefine/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.ejabberd.day"] \ No newline at end of file diff --git a/tests/dictionaries/60extra_variable_name_extra/makedict/mandatory.json b/tests/dictionaries/60extra_variable_name_extra/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60extra_variable_name_extra/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60familyaction/makedict/mandatory.json b/tests/dictionaries/60familyaction/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/60familyaction/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/60familyaction_mandatory/makedict/mandatory.json b/tests/dictionaries/60familyaction_mandatory/makedict/mandatory.json new file mode 100644 index 000000000..fef6ee510 --- /dev/null +++ b/tests/dictionaries/60familyaction_mandatory/makedict/mandatory.json @@ -0,0 +1 @@ +["extra.test.day"] \ No newline at end of file diff --git a/tests/dictionaries/61extra_dyn/makedict/mandatory.json b/tests/dictionaries/61extra_dyn/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/61extra_dyn/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/dictionaries/61extra_dyn_extra/makedict/mandatory.json b/tests/dictionaries/61extra_dyn_extra/makedict/mandatory.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/dictionaries/61extra_dyn_extra/makedict/mandatory.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/test_2_makedict.py b/tests/test_2_makedict.py index 0e6b6dc14..709b638da 100644 --- a/tests/test_2_makedict.py +++ b/tests/test_2_makedict.py @@ -2,6 +2,7 @@ from os.path import isfile, join, isdir from pytest import fixture from os import listdir, mkdir, environ from json import dump, load, dumps, loads +from pathlib import Path environ['TIRAMISU_LOCALE'] = 'en' @@ -49,6 +50,7 @@ def launch_flattener(test_dir, makedict_before = join(makedict_dir, 'before.json') makedict_after = join(makedict_dir, 'after.json') informations_file = join(test_dir, 'informations.json') + mandatory_file = Path(makedict_dir) / 'mandatory.json' modulepath = test_dir.replace('/', '.') + f'.tiramisu.{filename}' mod = __import__(modulepath) @@ -116,6 +118,8 @@ def launch_flattener(test_dir, config.property.add('force_store_value') # value_owner(makedict_after, config, filename) + # + mandatory(mandatory_file, config.value.mandatory(), filename) def value_owner(makedict_value_owner, config, filename): @@ -155,6 +159,22 @@ def value_owner(makedict_value_owner, config, filename): assert load(fh) == loads(dumps(ret)), f"error in file {makedict_value_owner}" +def mandatory(mandatory_file, mandatories, filename): + ret = [opt.path() for opt in mandatories] + if not mandatory_file.is_file(): + with mandatory_file.open('w') as fh: + dump(ret, fh) + if filename != 'base': + ret_prefix = {'1': [], '2': []} + for key in ret: + prefix, path = key.split('.', 1) + ret_prefix[prefix].append(path) + assert ret_prefix['1'] == ret_prefix['2'] + ret = ret_prefix['1'] + with mandatory_file.open() as fh: + assert load(fh) == ret, f"error in file {mandatory_file}" + + def test_dictionary(test_dir): test_dir = join(dico_dirs, test_dir) launch_flattener(test_dir, 'base')