diff --git a/doc/service/README.md b/doc/service/README.md index 9a9cd570d..3de409e3f 100644 --- a/doc/service/README.md +++ b/doc/service/README.md @@ -100,7 +100,7 @@ Dans ce cas, tous les services et les éléments qu'il compose avec un attribut La désactivation du service va créé un lien symbolique vers /dev/null. -Si vous ne voulez juste pas créé le fichier de service et ne pas faire de lien symbolique, il faut utiliser l'attribut undisable : +Si vous ne voulez juste pas créer le fichier de service et ne pas faire de lien symbolique, il faut utiliser l'attribut undisable : ``` diff --git a/src/rougail/annotator/__init__.py b/src/rougail/annotator/__init__.py index 6d0ff2383..f4eae62af 100644 --- a/src/rougail/annotator/__init__.py +++ b/src/rougail/annotator/__init__.py @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ from .variable import CONVERT_OPTION import importlib.resources -from os.path import dirname, join +from os.path import dirname, join, isfile from ..utils import load_modules @@ -83,7 +83,8 @@ class SpaceAnnotator: # pylint: disable=R0903 annotators = sorted(annotators, key=get_level) functions = [] for eosfunc_file in eosfunc_files: - functions.extend(dir(load_modules(eosfunc_file))) + if isfile(eosfunc_file): + functions.extend(dir(load_modules(eosfunc_file))) for annotator in annotators: annotator(objectspace, functions, diff --git a/src/rougail/annotator/check.py b/src/rougail/annotator/check.py index 2d41d78cb..ba64ee1fd 100644 --- a/src/rougail/annotator/check.py +++ b/src/rougail/annotator/check.py @@ -44,30 +44,31 @@ class Annotator(TargetAnnotator, ParamAnnotator): functions, *args, ): - if not hasattr(objectspace.space, 'constraints') or \ - not hasattr(objectspace.space.constraints, 'check'): - return self.objectspace = objectspace - self.let_none = True self.only_variable = True + self.target_is_uniq = False + self.allow_function = True self.functions = copy(functions) self.functions.extend(INTERNAL_FUNCTIONS) self.functions.extend(self.objectspace.rougailconfig['internal_functions']) - self.target_is_uniq = False - self.allow_function = True - self.convert_target(self.objectspace.space.constraints.check) - self.convert_param(self.objectspace.space.constraints.check) - self.check_check() - self.check_change_warning() - self.convert_valid_entier() - self.convert_check() - del objectspace.space.constraints.check + for path_prefix, constraints in self.get_constraints(): + if not hasattr(constraints, 'check'): + continue + self.convert_target(constraints.check, path_prefix) + self.convert_param(constraints.check, path_prefix) + self.check_check(constraints) + self.check_change_warning(constraints) + self.convert_valid_entier(constraints) + self.convert_check(constraints) + del constraints.check - def check_check(self): # pylint: disable=R0912 + def check_check(self, + constraints, + ): # pylint: disable=R0912 """valid and manage """ remove_indexes = [] - for check_idx, check in enumerate(self.objectspace.space.constraints.check): + for check_idx, check in enumerate(constraints.check): if not check.name in self.functions: msg = _(f'cannot find check function "{check.name}"') raise DictConsistencyError(msg, 1, check.xmlfiles) @@ -75,20 +76,24 @@ class Annotator(TargetAnnotator, ParamAnnotator): remove_indexes.append(check_idx) remove_indexes.sort(reverse=True) for idx in remove_indexes: - del self.objectspace.space.constraints.check[idx] + del constraints.check[idx] - def check_change_warning(self): + def check_change_warning(self, + constraints, + ): """convert level to "warnings_only" """ - for check in self.objectspace.space.constraints.check: + for check in constraints.check: check.warnings_only = check.level == 'warning' check.level = None - def convert_valid_entier(self) -> None: + def convert_valid_entier(self, + constraints, + ) -> None: """valid and manage """ remove_indexes = [] - for check_idx, check in enumerate(self.objectspace.space.constraints.check): + for check_idx, check in enumerate(constraints.check): if not check.name == 'valid_entier': continue remove_indexes.append(check_idx) @@ -111,12 +116,14 @@ class Annotator(TargetAnnotator, ParamAnnotator): raise DictConsistencyError(msg, 19, check.xmlfiles) remove_indexes.sort(reverse=True) for idx in remove_indexes: - del self.objectspace.space.constraints.check[idx] + del constraints.check[idx] - def convert_check(self) -> None: + def convert_check(self, + constraints, + ) -> None: """valid and manage """ - for check in self.objectspace.space.constraints.check: + for check in constraints.check: for target in check.target: if not hasattr(target.name, 'validators'): target.name.validators = [] diff --git a/src/rougail/annotator/condition.py b/src/rougail/annotator/condition.py index 3286bf0a1..9d57df95b 100644 --- a/src/rougail/annotator/condition.py +++ b/src/rougail/annotator/condition.py @@ -44,24 +44,24 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): *args, ): self.objectspace = objectspace - self.force_service_value = {} - if hasattr(objectspace.space, 'variables'): - self.convert_auto_freeze() - if not hasattr(objectspace.space, 'constraints') or \ - not hasattr(self.objectspace.space.constraints, 'condition'): - return self.target_is_uniq = False self.only_variable = False self.allow_function = False - self.convert_target(self.objectspace.space.constraints.condition) - self.check_condition_optional() - self.convert_condition_source() - self.convert_param(self.objectspace.space.constraints.condition) - self.check_source_target() - self.convert_xxxlist() - self.check_choice_option_condition() - self.remove_condition_with_empty_target() - self.convert_condition() + self.force_service_value = {} + if hasattr(objectspace.space, 'variables'): + self.convert_auto_freeze() + for path_prefix, constraints in self.get_constraints(): + if not hasattr(constraints, 'condition'): + continue + self.convert_target(constraints.condition, path_prefix) + self.check_condition_optional(constraints, path_prefix) + self.convert_condition_source(constraints, path_prefix) + self.convert_param(constraints.condition, path_prefix) + self.check_source_target(constraints) + self.convert_xxxlist(constraints, path_prefix) + self.check_choice_option_condition(constraints, path_prefix) + self.remove_condition_with_empty_target(constraints) + self.convert_condition(constraints, path_prefix) def valid_type_validation(self, obj, @@ -84,7 +84,10 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): if variable.auto_save: continue auto_freeze_variable = self.objectspace.rougailconfig['auto_freeze_variable'] - if not self.objectspace.paths.path_is_defined(auto_freeze_variable): + if not self.objectspace.paths.path_is_defined(auto_freeze_variable, + self.objectspace.rougailconfig['variable_namespace'], + variable.path_prefix, + ): msg = _(f'the variable "{variable.name}" is auto_freeze but there is no variable "{auto_freeze_variable}"') raise DictConsistencyError(msg, 81, variable.xmlfiles) new_condition = self.objectspace.condition(variable.xmlfiles) @@ -96,18 +99,22 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): new_condition.param = [new_param] new_target = self.objectspace.target(variable.xmlfiles) new_target.type = 'variable' - new_target.name = variable.path + path = variable.path + if variable.path_prefix: + path = path.split('.', 1)[-1] + new_target.name = path new_condition.target = [new_target] - if not hasattr(self.objectspace.space, 'constraints'): - self.objectspace.space.constraints = self.objectspace.constraints(variable.xmlfiles) - if not hasattr(self.objectspace.space.constraints, 'condition'): - self.objectspace.space.constraints.condition = [] - self.objectspace.space.constraints.condition.append(new_condition) + path_prefix, constraints = next(self.get_constraints(create=True, + path_prefix=variable.path_prefix, + )) + if not hasattr(constraints, 'condition'): + constraints.condition = [] + constraints.condition.append(new_condition) - def check_source_target(self): + def check_source_target(self, constraints): """verify that source != target in condition """ - for condition in self.objectspace.space.constraints.condition: + for condition in constraints.condition: for target in condition.target: if target.type == 'variable' and \ condition.source.path == target.name.path: @@ -115,25 +122,34 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): f'{condition.source.path}') raise DictConsistencyError(msg, 11, condition.xmlfiles) - def check_condition_optional(self): + def check_condition_optional(self, + constraints, + path_prefix, + ): """a condition with a optional **and** the source variable doesn't exist """ remove_conditions = [] - for idx, condition in enumerate(self.objectspace.space.constraints.condition): + for idx, condition in enumerate(constraints.condition): if condition.optional is False or \ - self.objectspace.paths.path_is_defined(condition.source): + self.objectspace.paths.path_is_defined(condition.source, + condition.namespace, + path_prefix, + ): continue remove_conditions.append(idx) if (hasattr(condition, 'apply_on_fallback') and condition.apply_on_fallback) or \ (not hasattr(condition, 'apply_on_fallback') and \ condition.name.endswith('_if_in')): - self.force_actions_to_variable(condition) + self.force_actions_to_variable(condition, + path_prefix, + ) remove_conditions.sort(reverse=True) for idx in remove_conditions: - self.objectspace.space.constraints.condition.pop(idx) + constraints.condition.pop(idx) def force_actions_to_variable(self, condition: 'self.objectspace.condition', + path_prefix, ) -> None: """force property to a variable for example disabled_if_not_in => variable.disabled = True @@ -144,7 +160,9 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): if target.type.endswith('list'): self.force_service_value[target.name] = main_action != 'disabled' continue - leader_or_var, variables = self._get_family_variables_from_target(target) + leader_or_var, variables = self._get_family_variables_from_target(target, + path_prefix, + ) setattr(leader_or_var, main_action, True) for action in actions[1:]: for variable in variables: @@ -162,35 +180,41 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): def _get_family_variables_from_target(self, target, + path_prefix, ): if target.type == 'variable': - if not self.objectspace.paths.is_leader(target.name.path): + if not self.objectspace.paths.is_leader(target.name): return target.name, [target.name] # it's a leader, so apply property to leadership - family_name = self.objectspace.paths.get_variable_family_path(target.name.path) namespace = target.name.namespace + family_name = self.objectspace.paths.get_variable_family_path(target.name.path, + namespace, + force_path_prefix=path_prefix, + ) else: family_name = target.name.path namespace = target.namespace variable = self.objectspace.paths.get_family(family_name, namespace, + path_prefix, ) if hasattr(variable, 'variable'): return variable, list(variable.variable.values()) return variable, [] - def convert_xxxlist(self): + def convert_xxxlist(self, constraints, path_prefix): """transform *list to variable or family """ fills = {} - for condition in self.objectspace.space.constraints.condition: + for condition in constraints.condition: remove_targets = [] for target_idx, target in enumerate(condition.target): if target.type.endswith('list'): - listvars = self.objectspace.list_conditions.get(target.type, - {}).get(target.name) + listvars = self.objectspace.paths.list_conditions[path_prefix].get(target.type, + {}).get(target.name) if listvars: - self._convert_xxxlist_to_fill(condition, + self._convert_xxxlist_to_fill(constraints, + condition, target, listvars, fills, @@ -204,6 +228,7 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): condition.target.pop(target_idx) def _convert_xxxlist_to_fill(self, + constraints, condition: 'self.objectspace.condition', target: 'self.objectspace.target', listvars: list, @@ -211,9 +236,11 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): ): for listvar in listvars: if target.name in self.force_service_value: + # do not add fill, just change default value listvar.default = self.force_service_value[target.name] continue if listvar.path in fills: + # a fill is already set for this path fill = fills[listvar.path] or_needed = True for param in fill.param: @@ -225,14 +252,17 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): else: fill = self.objectspace.fill(target.xmlfiles) new_target = self.objectspace.target(target.xmlfiles) - new_target.name = listvar.path + path = listvar.path + if listvar.path_prefix: + path = path.split('.', 1)[-1] + new_target.name = path fill.target = [new_target] fill.name = 'calc_value' fill.namespace = 'services' fill.index = 0 - if not hasattr(self.objectspace.space.constraints, 'fill'): - self.objectspace.space.constraints.fill = [] - self.objectspace.space.constraints.fill.append(fill) + if not hasattr(constraints, 'fill'): + constraints.fill = [] + constraints.fill.append(fill) fills[listvar.path] = fill param1 = self.objectspace.param(target.xmlfiles) param1.text = False @@ -255,7 +285,10 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): param3 = self.objectspace.param(target.xmlfiles) param3.name = f'condition_{fill.index}' param3.type = 'variable' - param3.text = condition.source.path + path = condition.source.path + if condition.source.path_prefix: + path = path.split('.', 1)[-1] + param3.text = path param3.propertyerror = False fill.param.append(param3) param4 = self.objectspace.param(target.xmlfiles) @@ -275,12 +308,17 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): param6.text = 'OR' fill.param.append(param6) - def convert_condition_source(self): + def convert_condition_source(self, constraints, path_prefix): """remove condition for ChoiceOption that don't have param """ - for condition in self.objectspace.space.constraints.condition: + for condition in constraints.condition: try: - condition.source = self.objectspace.paths.get_variable(condition.source) + condition.source = self.objectspace.paths.get_variable(condition.source, + condition.namespace, + allow_variable_namespace=True, + force_path_prefix=path_prefix, + add_path_prefix=True, + ) except DictConsistencyError as err: if err.errno == 36: msg = _(f'the source "{condition.source}" in condition cannot be a dynamic ' @@ -291,46 +329,58 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk): raise DictConsistencyError(msg, 23, condition.xmlfiles) from err raise err from err # pragma: no cover - def check_choice_option_condition(self): + def check_choice_option_condition(self, + constraints, + path_prefix, + ): """remove condition of ChoiceOption that doesn't match """ remove_conditions = [] - for condition_idx, condition in enumerate(self.objectspace.space.constraints.condition): - if condition.source.path in self.objectspace.valid_enums: - valid_enum = self.objectspace.valid_enums[condition.source.path]['values'] - remove_param = [param_idx for param_idx, param in enumerate(condition.param) \ - if param.type != 'variable' and param.text not in valid_enum] - if not remove_param: - continue - remove_param.sort(reverse=True) - for idx in remove_param: - del condition.param[idx] - if not condition.param and condition.name.endswith('_if_not_in'): - self.force_actions_to_variable(condition) - remove_conditions.append(condition_idx) + for condition_idx, condition in enumerate(constraints.condition): + if not self.objectspace.paths.has_valid_enums(condition.source.path, + condition.source.path_prefix, + ): + continue + valid_enum = self.objectspace.paths.get_valid_enums(condition.source.path, + condition.source.path_prefix, + ) + remove_param = [param_idx for param_idx, param in enumerate(condition.param) \ + if param.type != 'variable' and param.text not in valid_enum] + if not remove_param: + continue + remove_param.sort(reverse=True) + for idx in remove_param: + del condition.param[idx] + if not condition.param and condition.name.endswith('_if_not_in'): + self.force_actions_to_variable(condition, + path_prefix, + ) + remove_conditions.append(condition_idx) remove_conditions.sort(reverse=True) for idx in remove_conditions: - self.objectspace.space.constraints.condition.pop(idx) + constraints.condition.pop(idx) - def remove_condition_with_empty_target(self): + def remove_condition_with_empty_target(self, constraints): """remove condition with empty target """ # optional target are remove, condition could be empty remove_conditions = [condition_idx for condition_idx, condition in \ - enumerate(self.objectspace.space.constraints.condition) \ + enumerate(constraints.condition) \ if not condition.target] remove_conditions.sort(reverse=True) for idx in remove_conditions: - self.objectspace.space.constraints.condition.pop(idx) + constraints.condition.pop(idx) - def convert_condition(self): + def convert_condition(self, constraints, path_prefix): """valid and manage """ - for condition in self.objectspace.space.constraints.condition: + for condition in constraints.condition: actions = self.get_actions_from_condition(condition.name) for param in condition.param: for target in condition.target: - leader_or_variable, variables = self._get_family_variables_from_target(target) + leader_or_variable, variables = self._get_family_variables_from_target(target, + path_prefix, + ) # if option is already disable, do not apply disable_if_in # check only the first action (example of multiple actions: # 'hidden', 'frozen', 'force_default_on_freeze') diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index 43f2c90d1..82f3eec22 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -61,6 +61,17 @@ class Annotator(Walk): self.dynamic_families() self.convert_help() + def remove_empty_families(self) -> None: + """Remove all families without any variable + """ + removed_families = {} + for family, parent in self.get_families(with_parent=True): + if isinstance(family, self.objectspace.family) and not self._has_variable(family): + removed_families.setdefault(parent, []).append(family) + for parent, families in removed_families.items(): + for family in families: + del parent.variable[family.name] + def _has_variable(self, family: 'self.objectspace.family', ) -> bool: @@ -73,18 +84,6 @@ class Annotator(Walk): return True return False - def remove_empty_families(self) -> None: - """Remove all families without any variable - """ - #FIXME pas sous family - for families in self.objectspace.space.variables.values(): - removed_families = [] - for family_name, family in families.variable.items(): - if isinstance(family, self.objectspace.family) and not self._has_variable(family): - removed_families.append(family_name) - for family_name in removed_families: - del families.variable[family_name] - def family_names(self) -> None: """Set doc, path, ... to family """ @@ -268,7 +267,13 @@ class Annotator(Walk): for family in self.get_families(): if 'dynamic' not in vars(family): continue - family.suffixes = self.objectspace.paths.get_variable(family.dynamic, family.xmlfiles) + family.suffixes = self.objectspace.paths.get_variable(family.dynamic, + family.namespace, + xmlfiles=family.xmlfiles, + allow_variable_namespace=True, + force_path_prefix=family.path_prefix, + add_path_prefix=True, + ) del family.dynamic if not family.suffixes.multi: msg = _(f'dynamic family "{family.name}" must be linked ' diff --git a/src/rougail/annotator/fill.py b/src/rougail/annotator/fill.py index 35b64d12a..77e8c9a35 100644 --- a/src/rougail/annotator/fill.py +++ b/src/rougail/annotator/fill.py @@ -44,9 +44,6 @@ class Annotator(TargetAnnotator, ParamAnnotator): functions, *args, ): - if not hasattr(objectspace.space, 'constraints') or \ - not hasattr(objectspace.space.constraints, 'fill'): - return self.objectspace = objectspace self.functions = copy(functions) self.functions.extend(self.objectspace.rougailconfig['internal_functions']) @@ -55,10 +52,13 @@ class Annotator(TargetAnnotator, ParamAnnotator): self.target_is_uniq = True self.only_variable = True self.allow_function = False - self.convert_target(self.objectspace.space.constraints.fill) - self.convert_param(self.objectspace.space.constraints.fill) - self.fill_to_value() - del self.objectspace.space.constraints.fill + for path_prefix, constraints in self.get_constraints(): + if not hasattr(constraints, 'fill'): + continue + self.convert_target(constraints.fill, path_prefix) + self.convert_param(constraints.fill, path_prefix) + self.fill_to_value(constraints) + del constraints.fill def calc_is_multi(self, variable: 'self.objectspace.variable') -> bool: multi = variable.multi @@ -66,12 +66,12 @@ class Annotator(TargetAnnotator, ParamAnnotator): return multi if multi == 'submulti': return True - return not self.objectspace.paths.is_follower(variable.path) + return not self.objectspace.paths.is_follower(variable) - def fill_to_value(self) -> None: + def fill_to_value(self, constraints) -> None: """valid and manage """ - for fill in self.objectspace.space.constraints.fill: + for fill in constraints.fill: # test if the function exists if fill.name not in self.functions: msg = _(f'cannot find fill function "{fill.name}"') diff --git a/src/rougail/annotator/param.py b/src/rougail/annotator/param.py index ac59aa8b2..94309bfbc 100644 --- a/src/rougail/annotator/param.py +++ b/src/rougail/annotator/param.py @@ -46,7 +46,7 @@ class ParamAnnotator: """ return None - def convert_param(self, objects) -> None: + def convert_param(self, objects, path_prefix) -> None: """ valid and convert param """ for obj in objects: @@ -64,27 +64,32 @@ class ParamAnnotator: msg = _(f'"{param.type}" parameter must not have a value') raise DictConsistencyError(msg, 40, obj.xmlfiles) elif param.type == 'variable': - try: - path, suffix = self.objectspace.paths.get_variable_path(param.text, - obj.namespace, - param.xmlfiles, - ) - param.text = self.objectspace.paths.get_variable(path) - if variable_type and param.text.type != variable_type: - msg = _(f'"{obj.name}" has type "{variable_type}" but param ' - f'has type "{param.text.type}"') - raise DictConsistencyError(msg, 26, param.xmlfiles) - if suffix: - param.suffix = suffix - family_path = self.objectspace.paths.get_variable_family_path(path) - namespace = param.text.namespace - param.family = self.objectspace.paths.get_family(family_path, - namespace, - ) - except DictConsistencyError as err: - if err.errno != 42 or not param.optional: - raise err - param_to_delete.append(param_idx) + if not isinstance(param.text, self.objectspace.variable): + try: + param.text, suffix = self.objectspace.paths.get_variable_with_suffix(param.text, + obj.namespace, + param.xmlfiles, + path_prefix, + ) + if variable_type and param.text.type != variable_type: + msg = _(f'"{obj.name}" has type "{variable_type}" but param ' + f'has type "{param.text.type}"') + raise DictConsistencyError(msg, 26, param.xmlfiles) + if suffix: + param.suffix = suffix + namespace = param.text.namespace + family_path = self.objectspace.paths.get_variable_family_path(param.text.path, + namespace, + force_path_prefix=path_prefix, + ) + param.family = self.objectspace.paths.get_family(family_path, + namespace, + path_prefix, + ) + except DictConsistencyError as err: + if err.errno != 42 or not param.optional: + raise err + param_to_delete.append(param_idx) elif param.type == 'function': if not self.allow_function: msg = _(f'cannot use "function" type') @@ -101,7 +106,7 @@ class ParamAnnotator: # no param.text if param.type == 'suffix': for target in obj.target: - if not self.objectspace.paths.variable_is_dynamic(target.name.path): + if not self.objectspace.paths.is_dynamic(target.name): target_name = target.name if isinstance(target_name, self.objectspace.variable): target_name = target_name.name @@ -110,7 +115,7 @@ class ParamAnnotator: raise DictConsistencyError(msg, 53, obj.xmlfiles) elif param.type == 'index': for target in obj.target: - if not self.objectspace.paths.is_follower(target.name.path): + if not self.objectspace.paths.is_follower(target.name): msg = _(f'"{param.type}" parameter cannot be set with target ' f'"{target.name.name}" which is not a follower variable') raise DictConsistencyError(msg, 60, obj.xmlfiles) diff --git a/src/rougail/annotator/property.py b/src/rougail/annotator/property.py index fbc958cdb..85cfb9130 100644 --- a/src/rougail/annotator/property.py +++ b/src/rougail/annotator/property.py @@ -42,8 +42,16 @@ class Annotator(Walk): *args ) -> None: self.objectspace = objectspace - if hasattr(self.objectspace.space, 'services'): - self.convert_services() + services = [] + if not self.objectspace.paths.has_path_prefix() and hasattr(self.objectspace.space, 'services'): + services.append(self.objectspace.space.services) + elif hasattr(self.objectspace.space, 'variables'): + for path_prefix in self.objectspace.paths.get_path_prefixes(): + if path_prefix in self.objectspace.space.variables and \ + hasattr(self.objectspace.space.variables[path_prefix], 'services'): + services.append(self.objectspace.space.variables[path_prefix].services) + for service in services: + self.convert_services(service) if hasattr(self.objectspace.space, 'variables'): self.convert_family() self.convert_variable() @@ -57,12 +65,12 @@ class Annotator(Walk): if isinstance(variable, self.objectspace.variable) and variable.hidden is True and \ variable.name != self.objectspace.rougailconfig['auto_freeze_variable']: if not variable.auto_freeze and \ - not hasattr(variable, 'provider'): + not hasattr(variable, 'provider') and not hasattr(variable, 'supplier'): variable.frozen = True if not variable.auto_save and \ not variable.auto_freeze and \ 'force_default_on_freeze' not in vars(variable) and \ - not hasattr(variable, 'provider'): + not hasattr(variable, 'provider') and not hasattr(variable, 'supplier'): variable.force_default_on_freeze = True if not hasattr(variable, 'properties'): variable.properties = [] @@ -72,6 +80,11 @@ class Annotator(Walk): # for subprop in CONVERT_PROPERTIES.get(prop, [prop]): variable.properties.append(prop) setattr(variable, prop, None) + if hasattr(variable, 'unique') and variable.unique != 'nil': + if variable.unique == 'False': + variable.properties.append('notunique') + else: + variable.properties.append('unique') if hasattr(variable, 'mode') and variable.mode: variable.properties.append(variable.mode) variable.mode = None @@ -84,13 +97,13 @@ class Annotator(Walk): if not variable.properties: del variable.properties - def convert_services(self) -> None: + def convert_services(self, services) -> None: """convert services """ - self.convert_property(self.objectspace.space.services) - for services in self.objectspace.space.services.service.values(): - self.convert_property(services) - for service in vars(services).values(): + self.convert_property(services) + for services_ in services.service.values(): + self.convert_property(services_) + for service in vars(services_).values(): if not isinstance(service, self.objectspace.family): continue self.convert_property(service) diff --git a/src/rougail/annotator/service.py b/src/rougail/annotator/service.py index 5bad02aaf..58e8078cf 100644 --- a/src/rougail/annotator/service.py +++ b/src/rougail/annotator/service.py @@ -53,23 +53,39 @@ class Annotator: *args, ) -> None: self.objectspace = objectspace - self.uniq_overrides = [] + self.uniq_overrides = {} if 'network_type' not in self.objectspace.types: self.objectspace.types['network_type'] = self.objectspace.types['ip_type'] - if hasattr(self.objectspace.space, 'services'): - if not hasattr(self.objectspace.space.services, 'service'): - del self.objectspace.space.services - else: - self.convert_services() + services = [] + if not self.objectspace.paths.has_path_prefix(): + self.uniq_overrides[None] = [] + if hasattr(self.objectspace.space, 'services'): + if not hasattr(self.objectspace.space.services, 'service'): + del self.objectspace.space.services + else: + services.append((None, 'services', self.objectspace.space.services)) + elif hasattr(self.objectspace.space, 'variables'): + for path_prefix in self.objectspace.paths.get_path_prefixes(): + self.uniq_overrides[path_prefix] = [] + root_path = f'{path_prefix}.services' + if not path_prefix in self.objectspace.space.variables or \ + not hasattr(self.objectspace.space.variables[path_prefix], 'services'): + continue + if not hasattr(self.objectspace.space.variables[path_prefix].services, 'service'): + del self.objectspace.space.variables[path_prefix].services + else: + services.append((path_prefix, root_path, self.objectspace.space.variables[path_prefix].services)) + for path_prefix, root_path, service in services: + self.convert_services(path_prefix, root_path, service) - def convert_services(self): + def convert_services(self, path_prefix, root_path, services): """convert services to variables """ - self.objectspace.space.services.hidden = True - self.objectspace.space.services.name = 'services' - self.objectspace.space.services.doc = 'services' - self.objectspace.space.services.path = 'services' - for service_name, service in self.objectspace.space.services.service.items(): + services.hidden = True + services.name = 'services' + services.doc = 'services' + services.path = root_path + for service_name, service in services.service.items(): service.name = normalize_family(service_name) activate_obj = self._generate_element('boolean', None, @@ -77,19 +93,26 @@ class Annotator: 'activate', not service.disabled, service, - '.'.join(['services', service.name, 'activate']), + f'{root_path}.{service.name}', + path_prefix, ) service.disabled = None - for elttype, values in dict(vars(service)).items(): + dico = dict(vars(service)) + if 'type' not in dico: + if service.manage: + dico['type'] = service.type + else: + dico['type'] = 'none' + for elttype, values in dico.items(): if elttype == 'servicelist': - self.objectspace.list_conditions.setdefault('servicelist', - {}).setdefault( - values, - []).append(activate_obj) + self.objectspace.paths.list_conditions[path_prefix].setdefault('servicelist', + {}).setdefault( + values, + []).append(activate_obj) continue if elttype in ERASED_ATTRIBUTES: continue - if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE: + if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE and (elttype != 'type' or values != 'none'): msg = _(f'unmanage service cannot have "{elttype}"') raise DictConsistencyError(msg, 66, service.xmlfiles) if isinstance(values, (dict, list)): @@ -97,10 +120,14 @@ class Annotator: eltname = elttype + 's' else: eltname = elttype - path = '.'.join(['services', service.name, eltname]) + if hasattr(service, 'servicelist'): + if isinstance(values, dict): + for key, value in values.items(): + setattr(value, 'servicelist', service.servicelist) family = self._gen_family(eltname, - path, + f'{root_path}.{service.name}', service.xmlfiles, + path_prefix, with_informations=False, ) if isinstance(values, dict): @@ -108,22 +135,25 @@ class Annotator: family.family = self.make_group_from_elts(service_name, elttype, values, - path, + f'{root_path}.{service.name}.{eltname}', + root_path, + path_prefix, ) setattr(service, elttype, family) else: if not hasattr(service, 'information'): service.information = self.objectspace.information(service.xmlfiles) setattr(service.information, elttype, values) - service.path = '.'.join(['services', service.name]) + service.path = f'{root_path}.{service.name}' manage = self._generate_element('boolean', None, None, 'manage', service.manage, service, - '.'.join(['services', service.name, 'manage']), - ) + f'{root_path}.{service.name}', + path_prefix, + ) service.variable = [activate_obj, manage] service.doc = service_name @@ -132,6 +162,8 @@ class Annotator: elttype, elts, path, + root_path, + path_prefix, ): """Splits each objects into a group (and `OptionDescription`, in tiramisu terms) and build elements and its attributes (the `Options` in tiramisu terms) @@ -144,13 +176,17 @@ class Annotator: if hasattr(self, update_elt): getattr(self, update_elt)(elt, service_name, + path_prefix, ) c_name, subpath = self._get_name_path(elt, path, + root_path, + path_prefix, ) family = self._gen_family(c_name, - subpath, + subpath.rsplit('.', 1)[0], elt.xmlfiles, + path_prefix, ) family.variable = [] if hasattr(elt, 'disabled'): @@ -163,17 +199,18 @@ class Annotator: 'activate', not disabled, elt, - '.'.join([subpath, 'activate']), + subpath, + path_prefix, ) for key in dir(elt): if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES2: continue value = getattr(elt, key) - if key == listname: - self.objectspace.list_conditions.setdefault(listname, - {}).setdefault( - value, - []).append(activate_obj) + if key in [listname, 'servicelist']: + self.objectspace.paths.list_conditions[path_prefix].setdefault(key, + {}).setdefault( + value, + []).append(activate_obj) continue if key == 'name': dtd_key_type = elttype + '_type' @@ -189,7 +226,8 @@ class Annotator: key, value, elt, - f'{subpath}.{key}' + subpath, + path_prefix, )) else: setattr(family.information, key, value) @@ -201,6 +239,8 @@ class Annotator: def _get_name_path(self, elt, path: str, + root_path: str, + path_prefix: str, ) -> Tuple[str, str]: # create element name, if already exists, add _xx to be uniq if hasattr(elt, 'source') and elt.source: @@ -214,7 +254,7 @@ class Annotator: c_name += f'_{idx}' subpath = '{}.{}'.format(path, normalize_family(c_name)) try: - self.objectspace.paths.get_family(subpath, 'services') + self.objectspace.paths.get_family(subpath, root_path, path_prefix) except DictConsistencyError as err: if err.errno == 42: return c_name, subpath @@ -222,8 +262,9 @@ class Annotator: def _gen_family(self, name, - path, + subpath, xmlfiles, + path_prefix, with_informations=True, ): family = self.objectspace.family(xmlfiles) @@ -231,9 +272,10 @@ class Annotator: family.doc = name family.mode = None self.objectspace.paths.add_family('services', - path, + subpath, family, - None, + False, + force_path_prefix=path_prefix, ) if with_informations: family.information = self.objectspace.information(xmlfiles) @@ -247,13 +289,19 @@ class Annotator: value, elt, path, + path_prefix, ): # pylint: disable=R0913 variable = self.objectspace.variable(elt.xmlfiles) variable.name = normalize_family(key) variable.mode = None variable.type = type_ if type_ == 'symlink': - variable.opt = self.objectspace.paths.get_variable(value, xmlfiles=elt.xmlfiles) + variable.opt = self.objectspace.paths.get_variable(value, + self.objectspace.rougailconfig['variable_namespace'], + xmlfiles=elt.xmlfiles, + force_path_prefix=path_prefix, + add_path_prefix=True, + ) variable.multi = None needed_type = self.objectspace.types[dtd_key_type] if needed_type not in ('variable', variable.opt.type): @@ -267,22 +315,22 @@ class Annotator: variable.namespace = 'services' self.objectspace.paths.add_variable('services', path, - 'service', - False, variable, + force_path_prefix=path_prefix ) return variable def _update_override(self, override, service_name, + path_prefix, ): - if service_name in self.uniq_overrides: + if service_name in self.uniq_overrides[path_prefix]: msg = _('only one override is allowed by service, ' 'please use a variable multiple if you want have more than one IP') raise DictConsistencyError(msg, 69, override.xmlfiles) - self.uniq_overrides.append(service_name) + self.uniq_overrides[path_prefix].append(service_name) override.name = service_name if not hasattr(override, 'source'): override.source = service_name @@ -290,6 +338,7 @@ class Annotator: @staticmethod def _update_file(file_, service_name, + path_prefix, ): if not hasattr(file_, 'file_type') or file_.file_type == "filename": if not hasattr(file_, 'source'): @@ -302,8 +351,14 @@ class Annotator: def _update_ip(self, ip, service_name, + path_prefix, ) -> None: - variable = self.objectspace.paths.get_variable(ip.name, ip.xmlfiles) + variable = self.objectspace.paths.get_variable(ip.name, + ip.namespace, + xmlfiles=ip.xmlfiles, + force_path_prefix=path_prefix, + add_path_prefix=True, + ) if variable.type not in ['ip', 'network', 'network_cidr']: msg = _(f'ip cannot be linked to "{variable.type}" variable "{ip.name}"') raise DictConsistencyError(msg, 70, ip.xmlfiles) @@ -314,7 +369,12 @@ class Annotator: msg = _(f'ip with ip_type "{variable.type}" must have netmask') raise DictConsistencyError(msg, 64, ip.xmlfiles) if hasattr(ip, 'netmask'): - netmask = self.objectspace.paths.get_variable(ip.netmask, ip.xmlfiles) + netmask = self.objectspace.paths.get_variable(ip.netmask, + ip.namespace, + xmlfiles=ip.xmlfiles, + force_path_prefix=path_prefix, + add_path_prefix=True, + ) if netmask.type != 'netmask': msg = _(f'netmask in ip must have type "netmask", not "{netmask.type}"') raise DictConsistencyError(msg, 65, ip.xmlfiles) diff --git a/src/rougail/annotator/target.py b/src/rougail/annotator/target.py index 0639d61db..420c3b326 100644 --- a/src/rougail/annotator/target.py +++ b/src/rougail/annotator/target.py @@ -26,13 +26,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ from rougail.i18n import _ from rougail.error import DictConsistencyError +from rougail.annotator.variable import Walk -class TargetAnnotator: +class TargetAnnotator(Walk): """Target annotator """ def convert_target(self, objects, + path_prefix, ) -> None: """ valid and convert param """ @@ -52,13 +54,15 @@ class TargetAnnotator: # let's replace the target by the path try: if target.type == 'variable': - path, suffix = self.objectspace.paths.get_variable_path(target.name, - obj.namespace, - ) - target.name = self.objectspace.paths.get_variable(path) - if suffix: - msg = _(f'target to {target.name.path} with suffix is not allowed') - raise DictConsistencyError(msg, 35, obj.xmlfiles) + if not isinstance(target.name, self.objectspace.variable): + target.name, suffix = self.objectspace.paths.get_variable_with_suffix(target.name, + obj.namespace, + target.xmlfiles, + path_prefix, + ) + if suffix: + msg = _(f'target to {target.name.path} with suffix is not allowed') + raise DictConsistencyError(msg, 35, obj.xmlfiles) elif self.only_variable: msg = _(f'target to "{target.name}" with param type "{target.type}" ' f'is not allowed') @@ -73,6 +77,8 @@ class TargetAnnotator: raise DictConsistencyError(msg, 51, target.xmlfiles) target.name = self.objectspace.paths.get_family(target.name, obj.namespace, + path_prefix, + allow_variable_namespace=True, ) elif target.type.endswith('list') and \ obj.name not in ['disabled_if_in', 'disabled_if_not_in']: diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 7a8289d1d..99b2bbc00 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -75,9 +75,13 @@ class Annotator(Walk): # pylint: disable=R0903 if variable.value[0].type == 'calculation': variable.default = variable.value[0] elif variable.multi: - if not self.objectspace.paths.is_follower(variable.path): + if self.objectspace.paths.is_follower(variable): + if variable.multi != 'submulti' and len(variable.value) != 1: + msg = _(f'the follower "{variable.name}" without multi attribute can only have one value') + raise DictConsistencyError(msg, 87, variable.xmlfiles) + else: variable.default = [value.name for value in variable.value] - if not self.objectspace.paths.is_leader(variable.path): + if not self.objectspace.paths.is_leader(variable): if variable.multi == 'submulti': variable.default_multi = [value.name for value in variable.value] else: diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index b193a91dd..fd5254179 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from rougail.i18n import _ from rougail.error import DictConsistencyError -from rougail.objspace import convert_boolean +from rougail.objspace import convert_boolean, get_variables CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int), @@ -56,7 +56,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int), 'allow_ip': False}), 'web_address': dict(opttype="URLOption", initkwargs={'allow_ip': True, 'allow_without_dot': True}), - 'port': dict(opttype="PortOption", initkwargs={'allow_private': True}), + 'port': dict(opttype="PortOption", initkwargs={'allow_private': True, 'allow_protocol': True}), 'mac': dict(opttype="MACOption"), 'cidr': dict(opttype="IPOption", initkwargs={'cidr': True}), 'network_cidr': dict(opttype="NetworkOption", initkwargs={'cidr': True}), @@ -71,35 +71,56 @@ class Walk: def get_variables(self): """Iter all variables from the objectspace """ - for family in self.objectspace.space.variables.values(): - yield from self._get_variables(family) + yield from get_variables(self.objectspace) - def _get_variables(self, - family: 'self.objectspace.family', - ): - if not hasattr(family, 'variable'): - return - for variable in family.variable.values(): - if isinstance(variable, self.objectspace.family): - yield from self._get_variables(variable) - else: - yield variable - - def get_families(self): + def get_families(self, + with_parent: bool=False, + ): """Iter all families from the objectspace """ for family in self.objectspace.space.variables.values(): - yield from self._get_families(family) + yield from self._get_families(family, None, with_parent) def _get_families(self, family: 'self.objectspace.family', + old_family: 'self.objectspace.family', + with_parent: bool, ): - yield family - if not hasattr(family, 'variable'): - return - for fam in family.variable.values(): - if isinstance(fam, self.objectspace.family): - yield from self._get_families(fam) + if with_parent: + yield family, old_family, + if hasattr(family, 'variable'): + if not with_parent: + yield family + for fam in family.variable.values(): + if isinstance(fam, self.objectspace.family): + yield from self._get_families(fam, family, with_parent) + if hasattr(family, 'variables'): + for fam in family.variables.values(): + yield from self._get_families(fam, family, with_parent) + + def get_constraints(self, + create: bool=False, + path_prefix: str=None, + ): + if not self.objectspace.paths.has_path_prefix(): + if hasattr(self.objectspace.space, 'constraints'): + yield None, self.objectspace.space.constraints + elif create: + self.objectspace.space.constraints = self.objectspace.constraints(None) + yield None, self.objectspace.space.constraints + else: + if path_prefix: + path_prefixes = [path_prefix] + else: + path_prefixes = self.objectspace.paths.get_path_prefixes() + for path_prefix in path_prefixes: + if hasattr(self.objectspace.space, 'variables') and \ + path_prefix in self.objectspace.space.variables and \ + hasattr(self.objectspace.space.variables[path_prefix], 'constraints'): + yield path_prefix, self.objectspace.space.variables[path_prefix].constraints + elif create: + self.objectspace.space.variables[path_prefix].constraints = self.objectspace.constraints(None) + yield path_prefix, self.objectspace.space.variables[path_prefix].constraints class Annotator(Walk): # pylint: disable=R0903 @@ -166,7 +187,10 @@ class Annotator(Walk): # pylint: disable=R0903 elif choice.type == 'space': choice.name = ' ' elif choice.type == 'variable': - choice.name = self.objectspace.paths.get_variable(choice.name) + choice.name = self.objectspace.paths.get_variable(choice.name, + variable.namespace, + force_path_prefix=variable.path_prefix, + ) if not choice.name.multi: msg = _(f'only multi "variable" is allowed for a choice ' f'of variable "{variable.name}"') @@ -186,10 +210,10 @@ class Annotator(Walk): # pylint: disable=R0903 f'of all expected values ({values})') raise DictConsistencyError(msg, 15, value.xmlfiles) ref_choice = variable.choice[0] - self.objectspace.valid_enums[variable.path] = {'type': ref_choice.type, - 'values': values, - 'xmlfiles': ref_choice.xmlfiles, - } + self.objectspace.paths.set_valid_enums(variable.path, + values, + variable.path_prefix, + ) elif variable.type == 'choice': msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type') raise DictConsistencyError(msg, 4, variable.xmlfiles) diff --git a/src/rougail/config.py b/src/rougail/config.py index e9fb6e3e7..44d76d72c 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -56,4 +56,10 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')], 'default_files_group': 'root', 'default_files_included': 'no', 'default_overrides_engine': 'creole', + 'default_service_names_engine': 'none', + 'default_systemd_directory': '/systemd', + 'base_option_name': 'baseoption', + 'export_with_import': True, + 'force_convert_dyn_option_description': False, + 'suffix': '', } diff --git a/src/rougail/convert.py b/src/rougail/convert.py index 98917ff59..1cba05d66 100644 --- a/src/rougail/convert.py +++ b/src/rougail/convert.py @@ -50,6 +50,8 @@ from .xmlreflector import XMLReflector from .tiramisureflector import TiramisuReflector from .annotator import SpaceAnnotator from .error import DictConsistencyError +from .providersupplier import provider_supplier +from .utils import normalize_family class RougailConvert: @@ -60,56 +62,92 @@ class RougailConvert: ) -> None: if rougailconfig is None: rougailconfig = RougailConfig - xmlreflector = XMLReflector(rougailconfig) - rougailobjspace = RougailObjSpace(xmlreflector, - rougailconfig, - ) - self._load_dictionaries(xmlreflector, - rougailobjspace, - rougailconfig['variable_namespace'], - rougailconfig['dictionaries_dir'], - rougailconfig['variable_namespace_description'], + self.rougailconfig = rougailconfig + xmlreflector = XMLReflector(self.rougailconfig) + self.rougailobjspace = RougailObjSpace(xmlreflector, + self.rougailconfig, + ) + self.internal_functions = self.rougailconfig['internal_functions'] + self.functions_file = self.rougailconfig['functions_file'] + if not isinstance(self.functions_file, list): + self.functions_file = [self.functions_file] + self.dictionaries = False + self.annotator = False + self.reflector = None + + def load_dictionaries(self, + path_prefix: str=None, + ) -> None: + self.rougailobjspace.paths.set_path_prefix(normalize_family(path_prefix)) + self._load_dictionaries(self.rougailobjspace.xmlreflector, + self.rougailconfig['variable_namespace'], + self.rougailconfig['dictionaries_dir'], + path_prefix, + self.rougailconfig['variable_namespace_description'], ) - for namespace, extra_dir in rougailconfig['extra_dictionaries'].items(): - if namespace in ['services', rougailconfig['variable_namespace']]: + for namespace, extra_dir in self.rougailconfig['extra_dictionaries'].items(): + if namespace in ['services', self.rougailconfig['variable_namespace']]: msg = _(f'Namespace name "{namespace}" is not allowed') raise DictConsistencyError(msg, 21, None) - self._load_dictionaries(xmlreflector, - rougailobjspace, + self._load_dictionaries(self.rougailobjspace.xmlreflector, namespace, extra_dir, + path_prefix, ) - functions_file = rougailconfig['functions_file'] - if not isinstance(functions_file, list): - functions_file = [functions_file] - SpaceAnnotator(rougailobjspace, - functions_file, - ) - self.output = TiramisuReflector(rougailobjspace, - functions_file, - rougailconfig['internal_functions'], - ).get_text() + '\n' + if hasattr(self.rougailobjspace.space, 'variables'): + provider_supplier(self.rougailobjspace, + path_prefix, + ) + self.dictionaries = True - @staticmethod - def _load_dictionaries(xmlreflector: XMLReflector, - rougailobjspace: RougailObjSpace, + def _load_dictionaries(self, + xmlreflector: XMLReflector, namespace: str, xmlfolders: List[str], + path_prefix: str, namespace_description: str=None, ) -> List[str]: for xmlfile, document in xmlreflector.load_xml_from_folders(xmlfolders): - rougailobjspace.xml_parse_document(xmlfile, - document, - namespace, - namespace_description, - ) + self.rougailobjspace.xml_parse_document(xmlfile, + document, + namespace, + namespace_description, + path_prefix, + ) + + def annotate(self): + if self.annotator: + raise DictConsistencyError(_('Cannot execute annotate multiple time'), 85, None) + SpaceAnnotator(self.rougailobjspace, + self.functions_file, + ) + self.annotator = True + + def reflexion(self, + exclude_imports: list=[], + ): + if not self.dictionaries: + self.load_dictionaries() + if not self.annotator: + self.annotate() + if self.reflector: + raise DictConsistencyError(_('Cannot execute reflexion multiple time'), 86, None) + functions_file = [func for func in self.functions_file if func not in exclude_imports] + self.reflector = TiramisuReflector(self.rougailobjspace, + functions_file, + self.internal_functions, + self.rougailconfig, + ) def save(self, filename: str, ) -> str: """Return tiramisu object declaration as a string """ + if self.reflector is None: + self.reflexion() + output = self.reflector.get_text() + '\n' if filename: with open(filename, 'w') as tiramisu: - tiramisu.write(self.output) - return self.output + tiramisu.write(output) + return output diff --git a/src/rougail/data/rougail.dtd b/src/rougail/data/rougail.dtd index d86c5371e..225060a38 100644 --- a/src/rougail/data/rougail.dtd +++ b/src/rougail/data/rougail.dtd @@ -53,7 +53,7 @@ - + @@ -101,6 +101,7 @@ + @@ -112,6 +113,7 @@ + diff --git a/src/rougail/objspace.py b/src/rougail/objspace.py index 85c7ae823..f3281b4b9 100644 --- a/src/rougail/objspace.py +++ b/src/rougail/objspace.py @@ -29,7 +29,7 @@ from typing import Optional from .i18n import _ from .xmlreflector import XMLReflector -from .utils import valid_variable_family_name +from .utils import valid_variable_family_name, normalize_family from .error import SpaceObjShallNotBeUpdated, DictConsistencyError from .path import Path @@ -106,14 +106,13 @@ class RougailObjSpace: self.paths = Path(rougailconfig) self.forced_text_elts_as_name = set(FORCED_TEXT_ELTS_AS_NAME) - self.list_conditions = {} - self.valid_enums = {} self.booleans_attributs = [] self.has_dyn_option = False self.types = {} self.make_object_space_classes(xmlreflector) self.rougailconfig = rougailconfig + self.xmlreflector = xmlreflector def make_object_space_classes(self, xmlreflector: XMLReflector, @@ -171,13 +170,28 @@ class RougailObjSpace: document, namespace, namespace_description, + path_prefix, ): """Parses a Rougail XML file and populates the RougailObjSpace """ redefine_variables = [] + if path_prefix: + if not hasattr(self.space, 'variables'): + self.space.variables = {} + n_path_prefix = normalize_family(path_prefix) + if n_path_prefix not in self.space.variables: + space = self.variables([xmlfile]) + space.name = n_path_prefix + space.doc = path_prefix + space.path = path_prefix + self.space.variables[n_path_prefix] = space + else: + space = self.space.variables[n_path_prefix] + else: + space = self.space self._xml_parse(xmlfile, document, - self.space, + space, namespace, namespace_description, redefine_variables, @@ -196,13 +210,13 @@ class RougailObjSpace: # var to check unique family name in a XML file family_names = [] for child in document: - if is_dynamic: - is_sub_dynamic = True - else: - is_sub_dynamic = document.attrib.get('dynamic') is not None if not isinstance(child.tag, str): # doesn't proceed the XML commentaries continue + if is_dynamic: + is_sub_dynamic = True + else: + is_sub_dynamic = child.attrib.get('dynamic') is not None if namespace_description and child.tag == 'variables': child.attrib['description'] = namespace_description if child.tag == 'family': @@ -230,6 +244,7 @@ class RougailObjSpace: self.remove(child, variableobj, redefine_variables, + namespace, ) if not exists: self.set_path(namespace, @@ -238,6 +253,11 @@ class RougailObjSpace: space, is_sub_dynamic, ) + elif isinstance(variableobj, self.variable): + if 'name' in document.attrib: + family_name = document.attrib['name'] + else: + family_name = namespace self.add_to_tree_structure(variableobj, space, child, @@ -324,10 +344,10 @@ class RougailObjSpace: redefine = convert_boolean(subspace.get('redefine', default_redefine)) if redefine is True: if isinstance(existed_var, self.variable): # pylint: disable=E1101 - if namespace == self.rougailconfig['variable_namespace']: - redefine_variables.append(name) - else: - redefine_variables.append(space.path + '.' + name) +# if namespace == self.rougailconfig['variable_namespace']: +# redefine_variables.append(name) +# else: + redefine_variables.append(space.path + '.' + name) existed_var.xmlfiles.append(xmlfile) return True, existed_var exists = convert_boolean(subspace.get('exists', True)) @@ -355,7 +375,7 @@ class RougailObjSpace: def get_existed_obj(self, name: str, xmlfile: str, - space: str, + space, child, namespace: str, ) -> None: @@ -366,20 +386,19 @@ class RougailObjSpace: if child.tag == 'variable': # pylint: disable=E1101 if namespace != self.rougailconfig['variable_namespace']: name = space.path + '.' + name - if not self.paths.path_is_defined(name): + if not self.paths.path_is_defined(name, namespace): return None - old_family_name = self.paths.get_variable_family_path(name) + old_family_name = self.paths.get_variable_family_path(name, namespace) if space.path != old_family_name: msg = _(f'Variable "{name}" was previously create in family "{old_family_name}", ' f'now it is in "{space.path}"') raise DictConsistencyError(msg, 47, space.xmlfiles) - return self.paths.get_variable(name) - # it's not a family + return self.paths.get_variable(name, namespace) + # it's not a variable tag = FORCE_TAG.get(child.tag, child.tag) children = getattr(space, tag, {}) if name in children and isinstance(children[name], getattr(self, child.tag)): return children[name] - return None def set_text(self, child, @@ -422,6 +441,7 @@ class RougailObjSpace: child, variableobj, redefine_variables, + namespace, ): """Rougail object tree manipulations """ @@ -438,23 +458,34 @@ class RougailObjSpace: self.remove_condition(variableobj.name) if child.attrib.get('remove_fill', False): self.remove_fill(variableobj.name) - if child.tag == 'fill': + elif child.tag == 'fill': for target in child: - if target.tag == 'target' and target.text in redefine_variables: + if target.tag == 'target' and \ + self.paths.get_path(target.text, namespace) in redefine_variables: self.remove_fill(target.text) def remove_check(self, name): """Remove a check with a specified target """ - if hasattr(self.space.constraints, 'check'): - remove_checks = [] - for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101 - for target in check.target: - if target.name == name: - remove_checks.append(idx) - remove_checks.sort(reverse=True) - for idx in remove_checks: - self.space.constraints.check.pop(idx) # pylint: disable=E1101 + constraints = self.get_constraints() + if not constraints or not hasattr(constraints, 'check'): + return + remove_checks = [] + for idx, check in enumerate(constraints.check): # pylint: disable=E1101 + for target in check.target: + if target.name == name: + remove_checks.append(idx) + remove_checks.sort(reverse=True) + for idx in remove_checks: + constraints.check.pop(idx) # pylint: disable=E1101 + + def get_constraints(self): + path_prefix = self.paths.get_path_prefix() + if not path_prefix: + if hasattr(self.space, 'constraints'): + return self.space.constraints + elif hasattr(self.space.variables[path_prefix], 'constraints'): + return self.space.variables[path_prefix].constraints def remove_condition(self, name: str, @@ -462,12 +493,13 @@ class RougailObjSpace: """Remove a condition with a specified source """ remove_conditions = [] - for idx, condition in enumerate(self.space.constraints.condition): # pylint: disable=E1101 + constraints = self.get_constraints() + for idx, condition in enumerate(constraints.condition): # pylint: disable=E1101 if condition.source == name: remove_conditions.append(idx) remove_conditions.sort(reverse=True) for idx in remove_conditions: - del self.space.constraints.condition[idx] # pylint: disable=E1101 + del constraints.condition[idx] # pylint: disable=E1101 def remove_fill(self, name: str, @@ -475,13 +507,14 @@ class RougailObjSpace: """Remove a fill with a specified target """ remove_fills = [] - for idx, fill in enumerate(self.space.constraints.fill): # pylint: disable=E1101 + constraints = self.get_constraints() + for idx, fill in enumerate(constraints.fill): # pylint: disable=E1101 for target in fill.target: if target.name == name: remove_fills.append(idx) remove_fills.sort(reverse=True) for idx in remove_fills: - self.space.constraints.fill.pop(idx) # pylint: disable=E1101 + constraints.fill.pop(idx) # pylint: disable=E1101 def set_path(self, namespace, @@ -493,33 +526,24 @@ class RougailObjSpace: """Fill self.paths attributes """ if isinstance(variableobj, self.variable): # pylint: disable=E1101 - if 'name' in document.attrib: - family_name = document.attrib['name'] - else: - family_name = namespace - - if isinstance(space, self.family) and space.leadership: - leader = space.path - else: - leader = None self.paths.add_variable(namespace, - variableobj.name, space.path, - is_dynamic, variableobj, - leader, + is_dynamic, + isinstance(space, self.family) and space.leadership, ) elif isinstance(variableobj, self.family): # pylint: disable=E1101 - family_name = variableobj.name - if namespace != self.rougailconfig['variable_namespace']: - family_name = space.path + '.' + family_name self.paths.add_family(namespace, - family_name, - variableobj, space.path, + variableobj, + is_dynamic, ) elif isinstance(variableobj, self.variables): - variableobj.path = variableobj.name + path_prefix = self.paths.get_path_prefix() + if path_prefix: + variableobj.path = path_prefix + '.' + variableobj.name + else: + variableobj.path = variableobj.name @staticmethod def add_to_tree_structure(variableobj, @@ -538,3 +562,22 @@ class RougailObjSpace: getattr(space, child.tag).append(variableobj) else: setattr(space, child.tag, variableobj) + + +def get_variables(objectspace): + """Iter all variables from the objectspace + """ + for family in objectspace.space.variables.values(): + yield from _get_variables(family, objectspace.family) + + +def _get_variables(family, family_type): + if hasattr(family, 'variable'): + for variable in family.variable.values(): + if isinstance(variable, family_type): + yield from _get_variables(variable, family_type) + else: + yield variable + if hasattr(family, 'variables'): + for family in family.variables.values(): + yield from _get_variables(family, family_type) diff --git a/src/rougail/path.py b/src/rougail/path.py index a4a38762f..d5ef1a36e 100644 --- a/src/rougail/path.py +++ b/src/rougail/path.py @@ -40,138 +40,293 @@ class Path: ) -> None: self.variables = {} self.families = {} + #self.names = {} self.full_paths_families = {} self.full_paths_variables = {} + self.full_dyn_paths_families = {} + self.valid_enums = {} self.variable_namespace = rougailconfig['variable_namespace'] + self.providers = {} + self.suppliers = {} + self.list_conditions = {} + self.suffix = rougailconfig['suffix'] + self.index = 0 + + def set_path_prefix(self, prefix: str) -> None: + self._path_prefix = prefix + if prefix: + if None in self.full_paths_families: + raise DictConsistencyError(_(f'prefix "{prefix}" cannot be set if a prefix "None" exists'), 39, None) + else: + for old_prefix in self.full_paths_families: + if old_prefix != None: + raise DictConsistencyError(_(f'no prefix cannot be set if a prefix exists'), 84, None) + if prefix in self.full_paths_families: + raise DictConsistencyError(_(f'prefix "{prefix}" already exists'), 83, None) + self.full_paths_families[prefix] = {} + self.full_paths_variables[prefix] = {} + self.valid_enums[prefix] = {} + self.providers[prefix] = {} + self.suppliers[prefix] = {} + self.list_conditions[prefix] = {} + + def has_path_prefix(self) -> bool: + return None not in self.full_paths_families + + def get_path_prefixes(self) -> list: + return list(self.full_paths_families) + + def get_path_prefix(self) -> str: + return self._path_prefix # Family def add_family(self, namespace: str, - name: str, - variableobj: str, subpath: str, + variableobj: str, + is_dynamic: str, + force_path_prefix: str=None, ) -> str: # pylint: disable=C0111 """Add a new family """ + if force_path_prefix is None: + force_path_prefix = self._path_prefix + path = subpath + '.' + variableobj.name if namespace == self.variable_namespace: - full_name = '.'.join([subpath, name]) - if name in self.full_paths_families: - msg = _(f'Duplicate family name "{name}"') + if variableobj.name in self.full_paths_families[force_path_prefix]: + msg = _(f'Duplicate family name "{variableobj.name}"') raise DictConsistencyError(msg, 55, variableobj.xmlfiles) - self.full_paths_families[name] = full_name - else: - if '.' not in name: # pragma: no cover - msg = _(f'Variable "{name}" in namespace "{namespace}" must have dot') - raise DictConsistencyError(msg, 39, variableobj.xmlfiles) - full_name = name - if full_name in self.families and \ - self.families[full_name]['variableobj'] != variableobj: # pragma: no cover - msg = _(f'Duplicate family name "{name}"') + self.full_paths_families[force_path_prefix][variableobj.name] = path + if is_dynamic: + if subpath in self.full_dyn_paths_families: + dyn_subpath = self.full_dyn_paths_families[subpath] + else: + dyn_subpath = subpath + self.full_dyn_paths_families[path] = f'{dyn_subpath}.{variableobj.name}{{suffix}}' + if path in self.families: + msg = _(f'Duplicate family name "{path}"') raise DictConsistencyError(msg, 37, variableobj.xmlfiles) - if full_name in self.variables: - msg = _(f'A variable and a family has the same path "{full_name}"') + if path in self.variables: + msg = _(f'A variable and a family has the same path "{path}"') raise DictConsistencyError(msg, 56, variableobj.xmlfiles) - self.families[full_name] = dict(name=name, - namespace=namespace, - variableobj=variableobj, - ) - variableobj.path = full_name + self.families[path] = dict(name=path, + namespace=namespace, + variableobj=variableobj, + ) + self.set_name(variableobj, 'optiondescription_') + variableobj.path = path + variableobj.path_prefix = force_path_prefix def get_family(self, - name: str, + path: str, current_namespace: str, + path_prefix: str, + allow_variable_namespace: bool=False, ) -> 'Family': # pylint: disable=C0111 """Get a family """ - name = '.'.join([normalize_family(subname) for subname in name.split('.')]) - if name not in self.families and name in self.full_paths_families: - name = self.full_paths_families[name] - if name not in self.families: - raise DictConsistencyError(_(f'unknown option {name}'), 42, []) - dico = self.families[name] - if current_namespace not in [self.variable_namespace, 'services'] and \ - current_namespace != dico['namespace']: + if (current_namespace == self.variable_namespace or allow_variable_namespace) and path in self.full_paths_families[path_prefix]: + path = self.full_paths_families[path_prefix][path] + elif allow_variable_namespace and path_prefix: + path = f'{path_prefix}.{path}' + if path not in self.families: + raise DictConsistencyError(_(f'unknown option "{path}"'), 42, []) + dico = self.families[path] + if current_namespace != dico['namespace'] and \ + (not allow_variable_namespace or current_namespace != self.variable_namespace): msg = _(f'A family located in the "{dico["namespace"]}" namespace ' f'shall not be used in the "{current_namespace}" namespace') raise DictConsistencyError(msg, 38, []) return dico['variableobj'] - def is_leader(self, path): # pylint: disable=C0111 - """Is the variable is a leader - """ - variable = self._get_variable(path) - if not variable['leader']: - return False - leadership = self.get_family(variable['leader'], variable['variableobj'].namespace) - return next(iter(leadership.variable.values())).path == path + def _get_dyn_path(self, + subpath: str, + name: bool, + ) -> str: + if subpath in self.full_dyn_paths_families: + subpath = self.full_dyn_paths_families[subpath] + path = f'{subpath}.{name}{{suffix}}' + else: + path = f'{subpath}.{name}' + return path - def is_follower(self, path): - """Is the variable is a follower - """ - variable = self._get_variable(path) - if not variable['leader']: - return False - leadership = self.get_family(variable['leader'], variable['variableobj'].namespace) - return next(iter(leadership.variable.values())).path != path + def set_provider(self, + variableobj, + name, + family, + ): + if not hasattr(variableobj, 'provider'): + return + p_name = 'provider:' + variableobj.provider + if '.' in name: + msg = f'provider "{p_name}" not allowed in extra' + raise DictConsistencyError(msg, 82, variableobj.xmlfiles) + if p_name in self.providers[variableobj.path_prefix]: + msg = f'provider "{p_name}" declare multiple time' + raise DictConsistencyError(msg, 79, variableobj.xmlfiles) + self.providers[variableobj.path_prefix][p_name] = {'path': self._get_dyn_path(family, + name, + ), + 'option': variableobj, + } + + def get_provider(self, + name: str, + path_prefix: str=None, + ) -> 'self.objectspace.variable': + return self.providers[path_prefix][name]['option'] + + + def get_providers_path(self, path_prefix=None): + if path_prefix: + return {name: option['path'].split('.', 1)[-1] for name, option in self.providers[path_prefix].items()} + return {name: option['path'] for name, option in self.providers[path_prefix].items()} + + def set_supplier(self, + variableobj, + name, + family, + ): + if not hasattr(variableobj, 'supplier'): + return + s_name = 'supplier:' + variableobj.supplier + if '.' in name: + msg = f'supplier "{s_name}" not allowed in extra' + raise DictConsistencyError(msg, 82, variableobj.xmlfiles) + if s_name in self.suppliers[variableobj.path_prefix]: + msg = f'supplier "{s_name}" declare multiple time' + raise DictConsistencyError(msg, 79, variableobj.xmlfiles) + self.suppliers[variableobj.path_prefix][s_name] = {'path': self._get_dyn_path(family, + name), + 'option': variableobj, + } + + def get_supplier(self, + name: str, + path_prefix: str=None, + ) -> 'self.objectspace.variable': + return self.suppliers[path_prefix][name]['option'] + + def get_suppliers_path(self, path_prefix=None): + if path_prefix: + return {name: option['path'].split('.', 1)[-1] for name, option in self.suppliers[path_prefix].items()} + return {name: option['path'] for name, option in self.suppliers[path_prefix].items()} # Variable def add_variable(self, # pylint: disable=R0913 namespace: str, - name: str, - family: str, - is_dynamic: bool, - variableobj, - leader: 'self.objectspace.family'=None, + subpath: str, + variableobj: "self.objectspace.variable", + is_dynamic: bool=False, + is_leader: bool=False, + force_path_prefix: str=None, ) -> str: # pylint: disable=C0111 """Add a new variable (with path) """ - if '.' not in name: - full_path = '.'.join([family, name]) - if namespace == self.variable_namespace: - self.full_paths_variables[name] = full_path - else: - full_path = name - variableobj.path = full_path - if full_path in self.families: - msg = _(f'A family and a variable has the same path "{full_path}"') + if force_path_prefix is None: + force_path_prefix = self._path_prefix + path = subpath + '.' + variableobj.name + if namespace == self.variable_namespace: + self.full_paths_variables[force_path_prefix][variableobj.name] = path + if path in self.families: + msg = _(f'A family and a variable has the same path "{path}"') raise DictConsistencyError(msg, 57, variableobj.xmlfiles) - self.variables[full_path] = dict(name=name, - family=family, - leader=leader, - is_dynamic=is_dynamic, - variableobj=variableobj, - ) + if is_leader: + leader = subpath + else: + leader = None + self.variables[path] = dict(name=path, + family=subpath, + leader=leader, + is_dynamic=is_dynamic, + variableobj=variableobj, + ) + variableobj.path = path + variableobj.path_prefix = force_path_prefix + self.set_name(variableobj, 'option_') + + def set_name(self, + variableobj, + option_prefix, + ): + self.index += 1 + variableobj.reflector_name = f'{option_prefix}{self.index}{self.suffix}' def get_variable(self, name: str, + namespace: str, xmlfiles: List[str]=[], + allow_variable_namespace: bool=False, + force_path_prefix: str=None, + add_path_prefix: bool=False, ) -> 'Variable': # pylint: disable=C0111 """Get variable object from a path """ - variable, suffix = self._get_variable(name, with_suffix=True, xmlfiles=xmlfiles) + if force_path_prefix is None: + force_path_prefix = self._path_prefix + try: + variable, suffix = self._get_variable(name, + namespace, + with_suffix=True, + xmlfiles=xmlfiles, + path_prefix=force_path_prefix, + add_path_prefix=add_path_prefix, + ) + except DictConsistencyError as err: + if not allow_variable_namespace or err.errno != 42 or namespace == self.variable_namespace: + raise err from err + variable, suffix = self._get_variable(name, + self.variable_namespace, + with_suffix=True, + xmlfiles=xmlfiles, + path_prefix=force_path_prefix, + ) if suffix: raise DictConsistencyError(_(f"{name} is a dynamic variable"), 36, []) return variable['variableobj'] def get_variable_family_path(self, name: str, + namespace: str, xmlfiles: List[str]=False, + force_path_prefix: str=None, ) -> str: # pylint: disable=C0111 """Get the full path of a family """ - return self._get_variable(name, xmlfiles=xmlfiles)['family'] + if force_path_prefix is None: + force_path_prefix = self._path_prefix + return self._get_variable(name, + namespace, + xmlfiles=xmlfiles, + path_prefix=force_path_prefix, + )['family'] - def get_variable_path(self, - name: str, - current_namespace: str, - xmlfiles: List[str]=[], - ) -> str: # pylint: disable=C0111 + def get_variable_with_suffix(self, + name: str, + current_namespace: str, + xmlfiles: List[str], + path_prefix: str, + ) -> str: # pylint: disable=C0111 """get full path of a variable """ - dico, suffix = self._get_variable(name, - with_suffix=True, - xmlfiles=xmlfiles, - ) + try: + dico, suffix = self._get_variable(name, + current_namespace, + with_suffix=True, + xmlfiles=xmlfiles, + path_prefix=path_prefix, + add_path_prefix=True, + ) + except DictConsistencyError as err: + if err.errno != 42 or current_namespace == self.variable_namespace: + raise err from err + dico, suffix = self._get_variable(name, + self.variable_namespace, + with_suffix=True, + xmlfiles=xmlfiles, + path_prefix=path_prefix, + add_path_prefix=True, + ) namespace = dico['variableobj'].namespace if namespace not in [self.variable_namespace, 'services'] and \ current_namespace != 'services' and \ @@ -179,41 +334,131 @@ class Path: msg = _(f'A variable located in the "{namespace}" namespace shall not be used ' f'in the "{current_namespace}" namespace') raise DictConsistencyError(msg, 41, xmlfiles) - return dico['variableobj'].path, suffix + return dico['variableobj'], suffix def path_is_defined(self, path: str, + namespace: str, + force_path_prefix: str=None, ) -> str: # pylint: disable=C0111 """The path is a valid path """ - if '.' not in path and path not in self.variables and path in self.full_paths_variables: - return True + if namespace == self.variable_namespace: + if force_path_prefix is None: + force_path_prefix = self._path_prefix + return path in self.full_paths_variables[force_path_prefix] return path in self.variables - def variable_is_dynamic(self, - name: str, - ) -> bool: + def get_path(self, + path: str, + namespace: str, + ) -> str: + if namespace == self.variable_namespace: + if path not in self.full_paths_variables[self._path_prefix]: + return None + path = self.full_paths_variables[self._path_prefix][path] + else: + path = f'{self._path_prefix}.{path}' + return path + + def is_dynamic(self, variableobj) -> bool: """This variable is in dynamic family """ - return self._get_variable(name)['is_dynamic'] + return self._get_variable(variableobj.path, + variableobj.namespace, + path_prefix=variableobj.path_prefix, + )['is_dynamic'] + + def is_leader(self, variableobj): # pylint: disable=C0111 + """Is the variable is a leader + """ + path = variableobj.path + variable = self._get_variable(path, + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + if not variable['leader']: + return False + leadership = self.get_family(variable['leader'], + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + return next(iter(leadership.variable.values())).path == path + + def is_follower(self, variableobj) -> bool: + """Is the variable is a follower + """ + variable = self._get_variable(variableobj.path, + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + if not variable['leader']: + return False + leadership = self.get_family(variable['leader'], + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + return next(iter(leadership.variable.values())).path != variableobj.path + + def get_leader(self, variableobj) -> str: + variable = self._get_variable(variableobj.path, + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + if not variable['leader']: + raise Exception(f'cannot find leader for {variableobj.path}') + leadership = self.get_family(variable['leader'], + variableobj.namespace, + path_prefix=variableobj.path_prefix, + ) + return next(iter(leadership.variable.values())) def _get_variable(self, - name: str, + path: str, + namespace: str, with_suffix: bool=False, xmlfiles: List[str]=[], + path_prefix: str=None, + add_path_prefix: bool=False, ) -> str: - name = '.'.join([normalize_family(subname) for subname in name.split('.')]) - if name not in self.variables: - if '.' not in name and name in self.full_paths_variables: - name = self.full_paths_variables[name] - elif with_suffix: - for var_name, full_path in self.full_paths_variables.items(): - if name.startswith(var_name): - variable = self._get_variable(full_path) - if variable['is_dynamic']: - return variable, name[len(var_name):] - if name not in self.variables: - raise DictConsistencyError(_(f'unknown option "{name}"'), 42, xmlfiles) + if namespace == self.variable_namespace: + if path in self.full_paths_variables[path_prefix]: + path = self.full_paths_variables[path_prefix][path] + else: + if with_suffix: + for var_name, full_path in self.full_paths_variables[path_prefix].items(): + if not path.startswith(var_name): + continue + variable = self._get_variable(full_path, namespace, path_prefix=path_prefix) + if not variable['is_dynamic']: + continue + return variable, path[len(var_name):] + if path_prefix and add_path_prefix: + path = f'{path_prefix}.{path}' + elif path_prefix and add_path_prefix: + path = f'{path_prefix}.{path}' + #FIXME with_suffix and variable in extra? + if path not in self.variables: + raise DictConsistencyError(_(f'unknown option "{path}"'), 42, xmlfiles) if with_suffix: - return self.variables[name], None - return self.variables[name] + return self.variables[path], None + return self.variables[path] + + def set_valid_enums(self, + path, + values, + path_prefix, + ): + self.valid_enums[path_prefix][path] = values + + def has_valid_enums(self, + path: str, + path_prefix: str, + ) -> bool: + return path in self.valid_enums[path_prefix] + + def get_valid_enums(self, + path: str, + path_prefix: str, + ): + return self.valid_enums[path_prefix][path] diff --git a/src/rougail/providersupplier.py b/src/rougail/providersupplier.py new file mode 100644 index 000000000..59365929d --- /dev/null +++ b/src/rougail/providersupplier.py @@ -0,0 +1,41 @@ +"""Provider/supplier + +distribued with GPL-2 or later license + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +""" +from rougail.objspace import get_variables +from rougail.utils import normalize_family + + +def provider_supplier(objectspace, + path_prefix, + ): + n_path_prefix = normalize_family(path_prefix) + for variable in get_variables(objectspace): + if variable.path_prefix != n_path_prefix: + continue + if hasattr(variable, 'provider'): + family_name, variable.name = variable.path.rsplit('.', 1) + objectspace.paths.set_provider(variable, + variable.name, + family_name, + ) + if hasattr(variable, 'supplier'): + family_name, variable.name = variable.path.rsplit('.', 1) + objectspace.paths.set_supplier(variable, + variable.name, + family_name, + ) diff --git a/src/rougail/template/base.py b/src/rougail/template/base.py index 5d18cfab6..30aab7469 100644 --- a/src/rougail/template/base.py +++ b/src/rougail/template/base.py @@ -35,9 +35,11 @@ from os.path import dirname, join, isfile, isdir, abspath try: from tiramisu3 import Config, undefined + from tiramisu3.api import TiramisuOption from tiramisu3.error import PropertiesOptionError # pragma: no cover except ModuleNotFoundError: # pragma: no cover from tiramisu import Config, undefined + from tiramisu.api import TiramisuOption from tiramisu.error import PropertiesOptionError from ..config import RougailConfig @@ -57,6 +59,7 @@ log.addHandler(logging.NullHandler()) INFORMATIONS = {'files': ['source', 'mode', 'engine', 'included'], 'overrides': ['name', 'source', 'engine'], + 'service_names': ['doc', 'engine', 'type'], } DEFAULT = {'files': ['owner', 'group'], 'overrides': [], @@ -178,9 +181,13 @@ class RougailExtra: For example %%extra1.family.variable """ def __init__(self, + name: str, suboption: Dict, + path: str, ) -> None: + self._name = name self._suboption = suboption + self._path = path def __getattr__(self, key: str, @@ -188,7 +195,7 @@ class RougailExtra: try: return self._suboption[key] except KeyError: - raise AttributeError(f'unable to find extra "{key}"') + raise AttributeError(f'unable to find extra "{self._path}.{key}"') def __getitem__(self, key: str, @@ -202,10 +209,7 @@ class RougailExtra: return self._suboption.items() def __str__(self): - suboptions = {} - for key, value in self._suboption.items(): - suboptions[key] = str(value) - return f'' + return self._name class RougailBaseTemplate: @@ -334,6 +338,19 @@ class RougailBaseTemplate: destfilenames.append(destfilename) return destfilenames + async def load_variables(self): + for option in await self.config.option.list(type='all'): + namespace = await option.option.name() + is_variable_namespace = namespace == self.rougailconfig['variable_namespace'] + if namespace == 'services': + is_service_namespace = 'root' + else: + is_service_namespace = False + self.rougail_variables_dict[namespace] = await self._load_variables(option, + is_variable_namespace, + is_service_namespace, + ) + async def instance_files(self) -> None: """Run templatisation on all files """ @@ -342,17 +359,8 @@ class RougailBaseTemplate: except FileNotFoundError: ori_dir = None chdir(self.tmp_dir) - for option in await self.config.option.list(type='all'): - namespace = await option.option.name() - is_variable_namespace = namespace == self.rougailconfig['variable_namespace'] - if namespace == 'services': - is_service_namespace = 'root' - else: - is_service_namespace = False - self.rougail_variables_dict[namespace] = await self.load_variables(option, - is_variable_namespace, - is_service_namespace, - ) + if not self.rougail_variables_dict: + await self.load_variables() for templates_dir in self.templates_dir: for template in listdir(templates_dir): self.prepare_template(template, @@ -398,7 +406,7 @@ class RougailBaseTemplate: ) if included and fill.get('included', 'no') == 'content': files_to_delete.extend(destfilenames) - else: + elif 'name' in fill: self.log.debug(_(f"Instantiation of file '{fill['name']}' disabled")) self.post_instance_service(service_name) for filename in files_to_delete: @@ -483,14 +491,16 @@ class RougailBaseTemplate: ) -> None: # pragma: no cover raise NotImplementedError(_('cannot instanciate this service type override')) - async def load_variables(self, - optiondescription, - is_variable_namespace: str, - is_service_namespace: str, - ) -> RougailExtra: + async def _load_variables(self, + optiondescription, + is_variable_namespace: str, + is_service_namespace: str, + ) -> RougailExtra: """Load all variables and set it in RougailExtra objects """ variables = {} + if isinstance(self.config, TiramisuOption): + len_root_path = len(await self.config.option.path()) + 1 for option in await optiondescription.list('all'): if await option.option.isoptiondescription(): if await option.option.isleadership(): @@ -502,11 +512,15 @@ class RougailBaseTemplate: if is_variable_namespace: self.rougail_variables_dict[await suboption.option.name()] = leader else: + if isinstance(self.config, TiramisuOption): + path = (await suboption.option.path())[len_root_path:] + else: + path = await suboption.option.path() await leader._add_follower(self.config, await suboption.option.name(), - await suboption.option.path(), + path, ) - variables[leadership_name] = RougailExtra({leader_name: leader}) + variables[leadership_name] = RougailExtra(await optiondescription.option.name(), {leader_name: leader}, await optiondescription.option.path()) else: if is_service_namespace == 'root': new_is_service_namespace = 'service_name' @@ -517,10 +531,10 @@ class RougailBaseTemplate: new_is_service_namespace = is_service_namespace[:-1] else: new_is_service_namespace = is_service_namespace - subfamilies = await self.load_variables(option, - is_variable_namespace, - new_is_service_namespace, - ) + subfamilies = await self._load_variables(option, + is_variable_namespace, + new_is_service_namespace, + ) variables[await option.option.name()] = subfamilies else: if is_variable_namespace: @@ -528,7 +542,10 @@ class RougailBaseTemplate: self.rougail_variables_dict[await option.option.name()] = value if await option.option.issymlinkoption() and await option.option.isfollower(): value = [] - path = await option.option.path() + if isinstance(self.config, TiramisuOption): + path = (await option.option.path())[len_root_path:] + else: + path = await option.option.path() for index in range(await option.value.len()): value.append(await self.config.option(path, index).value.get()) else: @@ -543,4 +560,4 @@ class RougailBaseTemplate: variables, optiondescription, ) - return RougailExtra(variables) + return RougailExtra(await optiondescription.option.name(), variables, await optiondescription.option.path()) diff --git a/src/rougail/template/engine/none.py b/src/rougail/template/engine/none.py index fb35e89f9..e1e741be3 100644 --- a/src/rougail/template/engine/none.py +++ b/src/rougail/template/engine/none.py @@ -29,7 +29,12 @@ from shutil import copy def process(filename: str, + source: str, destfilename: str, **kwargs ): - copy(filename, destfilename) + if filename is not None: + copy(filename, destfilename) + else: + with open(destfilename, 'w') as fh: + fh.write(source) diff --git a/src/rougail/template/systemd.py b/src/rougail/template/systemd.py index b32a285d4..58b6a4cb5 100644 --- a/src/rougail/template/systemd.py +++ b/src/rougail/template/systemd.py @@ -104,7 +104,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil raise FileNotFound(_(f'Override source file "{source}" does not exist in {", ".join(self.templates_dir)}')) tmp_file = join(self.tmp_dir, source) service_name = filevar['name'] - destfile = f'/systemd/system/{service_name}.d/rougail.conf' + destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}.d/rougail.conf' return tmp_file, None, destfile, None def get_data_ip(self, @@ -134,7 +134,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil ): tmp_file = join(self.tmp_dir, service_name) var = None - destfile = f'/systemd/system/{service_name}' + destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}' return tmp_file, None, destfile, var @@ -148,7 +148,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil def target_service(self, service_name: str, target_name: str, - global_service: str, + global_service: bool, ): filename = f'{self.destinations_dir}/systemd/system/{target_name}.target.wants/{service_name}' makedirs(dirname(filename), exist_ok=True) @@ -163,7 +163,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil ) -> None: # pragma: no cover if self.ip_per_service is None: return - destfile = f'/systemd/system/{service_name}.d/rougail_ip.conf' + destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}.d/rougail_ip.conf' destfilename = join(self.destinations_dir, destfile[1:]) makedirs(dirname(destfilename), exist_ok=True) self.log.info(_(f"creole processing: '{destfilename}'")) diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 82c3602f0..5549305ee 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -32,13 +32,12 @@ from .i18n import _ from .annotator import CONVERT_OPTION from .objspace import RootRougailObject from .error import DictConsistencyError +from .utils import normalize_family class BaseElt: # pylint: disable=R0903 """Base element """ - name = 'baseoption' - doc = 'baseoption' path = '.' @@ -49,83 +48,105 @@ class TiramisuReflector: objectspace, funcs_paths, internal_functions, + cfg, ): - self.index = 0 - self.text = [] + self.cfg = cfg + self.text = {'header': [], + 'option': [], + 'optiondescription': [], + } if funcs_paths: - self.text.extend(["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", - "class func:", - " pass", - ]) + if self.cfg['export_with_import']: + self.text['header'].extend(["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", + "class func:", + " pass", + "", + "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", + " setattr(func, function, getattr(func_, function))", + ]) for funcs_path in funcs_paths: if not isfile(funcs_path): continue - self.text.extend([f"_loader = _SourceFileLoader('func', '{funcs_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", - " setattr(func, function, getattr(_func, function))", - ]) - if internal_functions: - for func in internal_functions: - self.text.append(f"setattr(func, '{func}', {func})") - self.text.extend(["try:", - " from tiramisu3 import *", - "except:", - " from tiramisu import *", - ]) + self.text['header'].append(f"_load_functions('{funcs_path}')") + if self.cfg['export_with_import']: + if internal_functions: + for func in internal_functions: + self.text['header'].append(f"setattr(func, '{func}', {func})") + self.text['header'].extend(["try:", + " from tiramisu3 import *", + "except:", + " from tiramisu import *", + ]) self.objectspace = objectspace self.make_tiramisu_objects() - if self.objectspace.has_dyn_option is True: - self.text.append("from rougail.tiramisu import ConvertDynOptionDescription") + if self.cfg['export_with_import'] and (self.cfg['force_convert_dyn_option_description'] or self.objectspace.has_dyn_option is True): + self.text['header'].append("from rougail.tiramisu import ConvertDynOptionDescription") def make_tiramisu_objects(self) -> None: """make tiramisu objects """ - providers = {} baseelt = BaseElt() + baseelt.reflector_name = f'option_0{self.objectspace.rougailconfig["suffix"]}' self.set_name(baseelt) - dynamic_path = '' - dynamic = False basefamily = Family(baseelt, self.text, self.objectspace, ) - for elt in self.reorder_family(): - self.populate_family(basefamily, - elt, - providers, - dynamic, - dynamic_path, - ) - basefamily.elt.information = providers - basefamily.populate_informations() - self.baseelt = baseelt + if not self.objectspace.paths.has_path_prefix(): + for elt in self.reorder_family(self.objectspace.space): + self.populate_family(basefamily, + elt, + ) + basefamily.populate_informations() + basefamily.elt.information = self.objectspace.paths.get_providers_path() + basefamily.elt.information.update(self.objectspace.paths.get_suppliers_path()) + else: + path_prefixes = self.objectspace.paths.get_path_prefixes() + for path_prefix in path_prefixes: + space = self.objectspace.space.variables[path_prefix] + self.set_name(space) + baseprefix = Family(space, + self.text, + self.objectspace, + ) + basefamily.add(baseprefix) + for elt in self.reorder_family(space): + self.populate_family(baseprefix, + elt, + ) + baseprefix.populate_informations() + baseprefix.elt.information = self.objectspace.paths.get_providers_path(path_prefix) + baseprefix.elt.information.update(self.objectspace.paths.get_suppliers_path(path_prefix)) + baseelt.name = normalize_family(self.cfg['base_option_name']) + baseelt.doc = self.cfg['base_option_name'] + baseelt.reflector_object.get([], baseelt.doc, 'base') # pylint: disable=E1101 - def reorder_family(self): + def reorder_family(self, space): """variable_namespace family has to be loaded before any other family because `extra` family could use `variable_namespace` variables. """ - if hasattr(self.objectspace.space, 'variables'): + if hasattr(space, 'variables'): variable_namespace = self.objectspace.rougailconfig['variable_namespace'] - if variable_namespace in self.objectspace.space.variables: - yield self.objectspace.space.variables[variable_namespace] - for elt, value in self.objectspace.space.variables.items(): + if variable_namespace in space.variables: + yield space.variables[variable_namespace] + for elt, value in space.variables.items(): if elt != self.objectspace.rougailconfig['variable_namespace']: yield value - if hasattr(self.objectspace.space, 'services'): - yield self.objectspace.space.services + if hasattr(space, 'services'): + yield space.services def populate_family(self, parent_family, elt, - providers, - dynamic, - dynamic_path, ): """Populate family """ @@ -134,21 +155,11 @@ class TiramisuReflector: self.text, self.objectspace, ) - if not dynamic_path: - dynamic_path = elt.name - else: - dynamic_path = dynamic_path + '.' + elt.name - if dynamic or hasattr(elt, 'suffixes'): - dynamic_path += '{suffix}' - dynamic = True parent_family.add(family) for children in vars(elt).values(): if isinstance(children, self.objectspace.family): self.populate_family(family, children, - providers, - dynamic, - dynamic_path, ) continue if isinstance(children, dict): @@ -160,21 +171,13 @@ class TiramisuReflector: continue if isinstance(child, self.objectspace.variable): self.set_name(child) - sub_dynamic_path = dynamic_path + '.' + child.name - if dynamic: - sub_dynamic_path += '{suffix}' family.add(Variable(child, self.text, self.objectspace, - providers, - sub_dynamic_path, )) else: self.populate_family(family, child, - providers, - dynamic, - dynamic_path, ) def set_name(self, @@ -182,14 +185,14 @@ class TiramisuReflector: ): """Set name """ - elt.reflector_name = f'option_{self.index}' - self.index += 1 + if not hasattr(elt, 'reflector_name'): + self.objectspace.paths.set_name(elt, 'optiondescription_') + return elt.reflector_name def get_text(self): """Get text """ - self.baseelt.reflector_object.get([]) # pylint: disable=E1101 - return '\n'.join(self.text) + return '\n'.join(self.text['header'] + self.text['option'] + self.text['optiondescription']) class Common: @@ -207,7 +210,7 @@ class Common: self.elt.reflector_object = self self.object_type = None - def get(self, calls): + def get(self, calls, parent_name, typ): """Get tiramisu's object """ self_calls = calls.copy() @@ -220,12 +223,6 @@ class Common: self.option_name = self.elt.reflector_name self.populate_attrib() self.populate_informations() - if hasattr(self.elt, 'provider'): - name = 'provider:' + self.elt.provider - if name in self.providers: - msg = f'provider {name} declare multiple time' - raise DictConsistencyError(msg, 79, self.elt.xmlfiles) - self.providers[name] = self.dynamic_path return self.option_name def populate_attrib(self): @@ -238,7 +235,13 @@ class Common: if hasattr(self.elt, 'properties'): keys['properties'] = self.properties_to_string(self.elt.properties) attrib = ', '.join([f'{key}={value}' for key, value in keys.items()]) - self.text.append(f'{self.option_name} = {self.object_type}({attrib})') + if self.__class__.__name__ == 'Family': + #pouet + name = 'option' + #name = 'optiondescription' + else: + name = 'option' + self.text[name].append(f'{self.option_name} = {self.object_type}({attrib})') def _populate_attrib(self, keys: dict, @@ -267,7 +270,7 @@ class Common: ) -> str: """Populate properties """ - option_name = child.source.reflector_object.get(self.calls) + option_name = child.source.reflector_object.get(self.calls, self.elt.path, 'property') kwargs = (f"'condition': ParamOption({option_name}, todict=True, notraisepropertyerror=True), " f"'expected': {self.populate_param(child.expected)}") if child.inverse: @@ -289,7 +292,8 @@ class Common: continue if isinstance(value, str): value = self.convert_str(value) - self.text.append(f"{self.option_name}.impl_set_information('{key}', {value})") + #pouet self.text['optiondescription'].append(f"{self.option_name}.impl_set_information('{key}', {value})") + self.text['option'].append(f"{self.option_name}.impl_set_information('{key}', {value})") def populate_param(self, param, @@ -301,7 +305,7 @@ class Common: if param.type == 'string' and value is not None: value = self.convert_str(value) return f'ParamValue({value})' - if param.type == 'variable': + if param.type in ['variable_name', 'variable']: return self.build_option_param(param) if param.type == 'information': if hasattr(self.elt, 'multi') and self.elt.multi: @@ -322,11 +326,14 @@ class Common: ) -> str: """build variable parameters """ - option_name = param.text.reflector_object.get(self.calls) + if param.type == 'variable': + option_name = param.text.reflector_object.get(self.calls, self.elt.path, 'param') + else: + option_name = param.text params = [f'{option_name}'] if hasattr(param, 'suffix'): param_type = 'ParamDynOption' - family = param.family.reflector_object.get(self.calls) + family = param.family.reflector_object.get(self.calls, self.elt.path, 'suffix') params.extend([f"'{param.suffix}'", f'{family}']) else: param_type = 'ParamOption' @@ -342,11 +349,7 @@ class Variable(Common): elt, text, objectspace, - providers, - dynamic_path, ): - self.providers = providers - self.dynamic_path = dynamic_path super().__init__(elt, text, objectspace) self.object_type = CONVERT_OPTION[elt.type]['opttype'] @@ -354,11 +357,11 @@ class Variable(Common): keys: dict, ): if hasattr(self.elt, 'opt'): - keys['opt'] = self.elt.opt.reflector_object.get(self.calls) + keys['opt'] = self.elt.opt.reflector_object.get(self.calls, self.elt.path, 'opt') if hasattr(self.elt, 'choice'): values = self.elt.choice if values[0].type == 'variable': - value = values[0].name.reflector_object.get(self.calls) + value = values[0].name.reflector_object.get(self.calls, self.elt.path, 'choice') keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))" elif values[0].type == 'function': keys['values'] = self.calculation_value(values[0], []) @@ -447,6 +450,6 @@ class Family(Common): keys: list, ) -> None: if hasattr(self.elt, 'suffixes'): - dyn = self.elt.suffixes.reflector_object.get(self.calls) + dyn = self.elt.suffixes.reflector_object.get(self.calls, self.elt.path, 'suffixes') keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}, notraisepropertyerror=True))))" - keys['children'] = '[' + ', '.join([child.get(self.calls) for child in self.children]) + ']' + keys['children'] = '[' + ', '.join([child.get(self.calls, self.elt.path, 'child') for child in self.children]) + ']' diff --git a/src/rougail/utils.py b/src/rougail/utils.py index f80b00de8..a48472159 100644 --- a/src/rougail/utils.py +++ b/src/rougail/utils.py @@ -50,6 +50,8 @@ def valid_variable_family_name(name: str, def normalize_family(family_name: str) -> str: """replace space, accent, uppercase, ... by valid character """ + if not family_name: + return family_name = family_name.replace('-', '_').replace(' ', '_').replace('.', '_') nfkd_form = normalize('NFKD', family_name) family_name = ''.join([c for c in nfkd_form if not combining(c)]) diff --git a/src/rougail/xmlreflector.py b/src/rougail/xmlreflector.py index 6021f1aa9..d447ab04b 100644 --- a/src/rougail/xmlreflector.py +++ b/src/rougail/xmlreflector.py @@ -66,9 +66,10 @@ class XMLReflector: for filename in listdir(xmlfolder): if not filename.endswith('.xml'): continue + full_filename = join(xmlfolder, filename) if filename in filenames: - raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [xmlfolder]) - filenames[filename] = join(xmlfolder, filename) + raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [filenames[filename], full_filename]) + filenames[filename] = full_filename if not filenames: raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder]) file_names = list(filenames.keys()) diff --git a/tests/dictionaries/00empty/00_base.xml b/tests/dictionaries/00empty/00_base.xml index ef9ac4b46..17be1b823 100644 --- a/tests/dictionaries/00empty/00_base.xml +++ b/tests/dictionaries/00empty/00_base.xml @@ -2,6 +2,6 @@ - + diff --git a/tests/dictionaries/00empty/tiramisu/base.py b/tests/dictionaries/00empty/tiramisu/base.py index d97201fd2..123086844 100644 --- a/tests/dictionaries/00empty/tiramisu/base.py +++ b/tests/dictionaries/00empty/tiramisu/base.py @@ -2,20 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="activate", doc="activate", default=True) -option_4 = BoolOption(name="manage", doc="manage", default=True) -option_2 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4]) -option_1 = OptionDescription(name="services", doc="services", children=[option_2], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="activate", doc="activate", default=True) +option_2 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_4 = OptionDescription(name="tata_service", doc="tata.service", children=[option_1, option_2]) +optiondescription_4.impl_set_information('type', "service") +optiondescription_3 = OptionDescription(name="services", doc="services", children=[optiondescription_4], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/00empty/tiramisu/multi.py b/tests/dictionaries/00empty/tiramisu/multi.py new file mode 100644 index 000000000..dd41836ff --- /dev/null +++ b/tests/dictionaries/00empty/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="activate", doc="activate", default=True) +option_2 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="tata_service", doc="tata.service", children=[option_1, option_2]) +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_8]) diff --git a/tests/dictionaries/00load_autofreeze/tiramisu/base.py b/tests/dictionaries/00load_autofreeze/tiramisu/base.py index 38f83d606..3c9f5dc5e 100644 --- a/tests/dictionaries/00load_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/00load_autofreeze/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) -option_2 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/00load_autofreeze/tiramisu/multi.py b/tests/dictionaries/00load_autofreeze/tiramisu/multi.py new file mode 100644 index 000000000..fc5f546d0 --- /dev/null +++ b/tests/dictionaries/00load_autofreeze/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py b/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py index a47818918..f89a6edea 100644 --- a/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py +++ b/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) -option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/00load_autofreezeexpert/tiramisu/multi.py b/tests/dictionaries/00load_autofreezeexpert/tiramisu/multi.py new file mode 100644 index 000000000..ff66a2573 --- /dev/null +++ b/tests/dictionaries/00load_autofreezeexpert/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/00load_autosave/tiramisu/base.py b/tests/dictionaries/00load_autosave/tiramisu/base.py index 9c2c6f7a3..ae784f319 100644 --- a/tests/dictionaries/00load_autosave/tiramisu/base.py +++ b/tests/dictionaries/00load_autosave/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"})) -option_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"basic"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/00load_autosave/tiramisu/multi.py b/tests/dictionaries/00load_autosave/tiramisu/multi.py new file mode 100644 index 000000000..cf4fa3215 --- /dev/null +++ b/tests/dictionaries/00load_autosave/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, optiondescription_5]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/00load_autosaveexpert/tiramisu/base.py b/tests/dictionaries/00load_autosaveexpert/tiramisu/base.py index 0ecb32adc..ab426b67b 100644 --- a/tests/dictionaries/00load_autosaveexpert/tiramisu/base.py +++ b/tests/dictionaries/00load_autosaveexpert/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"})) -option_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/00load_autosaveexpert/tiramisu/multi.py b/tests/dictionaries/00load_autosaveexpert/tiramisu/multi.py new file mode 100644 index 000000000..66812ea08 --- /dev/null +++ b/tests/dictionaries/00load_autosaveexpert/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, optiondescription_5]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/00load_comment/tiramisu/base.py b/tests/dictionaries/00load_comment/tiramisu/base.py index 1c28aebf1..ae7b258f8 100644 --- a/tests/dictionaries/00load_comment/tiramisu/base.py +++ b/tests/dictionaries/00load_comment/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/00load_comment/tiramisu/multi.py b/tests/dictionaries/00load_comment/tiramisu/multi.py new file mode 100644 index 000000000..fa75794d7 --- /dev/null +++ b/tests/dictionaries/00load_comment/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/00load_notype/tiramisu/base.py b/tests/dictionaries/00load_notype/tiramisu/base.py index 3bbf2e7dd..127e8c3de 100644 --- a/tests/dictionaries/00load_notype/tiramisu/base.py +++ b/tests/dictionaries/00load_notype/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/00load_notype/tiramisu/multi.py b/tests/dictionaries/00load_notype/tiramisu/multi.py new file mode 100644 index 000000000..af65f8990 --- /dev/null +++ b/tests/dictionaries/00load_notype/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="général", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/00load_save/tiramisu/base.py b/tests/dictionaries/00load_save/tiramisu/base.py index 1c28aebf1..ae7b258f8 100644 --- a/tests/dictionaries/00load_save/tiramisu/base.py +++ b/tests/dictionaries/00load_save/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/00load_save/tiramisu/multi.py b/tests/dictionaries/00load_save/tiramisu/multi.py new file mode 100644 index 000000000..fa75794d7 --- /dev/null +++ b/tests/dictionaries/00load_save/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/00load_subfolder/tiramisu/base.py b/tests/dictionaries/00load_subfolder/tiramisu/base.py index 0876d1c9e..9ddec3dc1 100644 --- a/tests/dictionaries/00load_subfolder/tiramisu/base.py +++ b/tests/dictionaries/00load_subfolder/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/00load_subfolder/tiramisu/multi.py b/tests/dictionaries/00load_subfolder/tiramisu/multi.py new file mode 100644 index 000000000..091383e9d --- /dev/null +++ b/tests/dictionaries/00load_subfolder/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="général", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01auto_autofreeze/tiramisu/base.py b/tests/dictionaries/01auto_autofreeze/tiramisu/base.py index 20e6c5b78..d6d47e807 100644 --- a/tests/dictionaries/01auto_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01auto_autofreeze/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01auto_autofreeze/tiramisu/multi.py b/tests/dictionaries/01auto_autofreeze/tiramisu/multi.py new file mode 100644 index 000000000..c5c0061a9 --- /dev/null +++ b/tests/dictionaries/01auto_autofreeze/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01auto_base/tiramisu/base.py b/tests/dictionaries/01auto_base/tiramisu/base.py index 60db379ef..482ee4222 100644 --- a/tests/dictionaries/01auto_base/tiramisu/base.py +++ b/tests/dictionaries/01auto_base/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01auto_base/tiramisu/multi.py b/tests/dictionaries/01auto_base/tiramisu/multi.py new file mode 100644 index 000000000..403b41801 --- /dev/null +++ b/tests/dictionaries/01auto_base/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01auto_withoutparam/tiramisu/base.py b/tests/dictionaries/01auto_withoutparam/tiramisu/base.py index 45dd37ed1..4d1b839e0 100644 --- a/tests/dictionaries/01auto_withoutparam/tiramisu/base.py +++ b/tests/dictionaries/01auto_withoutparam/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01auto_withoutparam/tiramisu/multi.py b/tests/dictionaries/01auto_withoutparam/tiramisu/multi.py new file mode 100644 index 000000000..537e9e5a7 --- /dev/null +++ b/tests/dictionaries/01auto_withoutparam/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01base_domainname/tiramisu/base.py b/tests/dictionaries/01base_domainname/tiramisu/base.py index 9272bdb85..d1e79ea46 100644 --- a/tests/dictionaries/01base_domainname/tiramisu/base.py +++ b/tests/dictionaries/01base_domainname/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_domainname/tiramisu/multi.py b/tests/dictionaries/01base_domainname/tiramisu/multi.py new file mode 100644 index 000000000..8a0fc89b6 --- /dev/null +++ b/tests/dictionaries/01base_domainname/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_file/tiramisu/base.py b/tests/dictionaries/01base_file/tiramisu/base.py index bcd47e871..a9acf95e0 100644 --- a/tests/dictionaries/01base_file/tiramisu/base.py +++ b/tests/dictionaries/01base_file/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/01base_file/tiramisu/multi.py b/tests/dictionaries/01base_file/tiramisu/multi.py new file mode 100644 index 000000000..35f62a28c --- /dev/null +++ b/tests/dictionaries/01base_file/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/file") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "file") +option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "file2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/01base_file_disabled/tiramisu/base.py b/tests/dictionaries/01base_file_disabled/tiramisu/base.py index 85da66548..3536313a0 100644 --- a/tests/dictionaries/01base_file_disabled/tiramisu/base.py +++ b/tests/dictionaries/01base_file_disabled/tiramisu/base.py @@ -2,37 +2,42 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_14 = FilenameOption(name="name", doc="name", default="/etc/file3") -option_15 = BoolOption(name="activate", doc="activate", default=False) -option_13 = OptionDescription(name="file3", doc="file3", children=[option_14, option_15]) -option_13.impl_set_information('source', "file3") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +option_13 = FilenameOption(name="name", doc="name", default="/etc/file3") +option_12 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_11 = OptionDescription(name="file3", doc="file3", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file3") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/01base_file_disabled/tiramisu/multi.py b/tests/dictionaries/01base_file_disabled/tiramisu/multi.py new file mode 100644 index 000000000..77b69e075 --- /dev/null +++ b/tests/dictionaries/01base_file_disabled/tiramisu/multi.py @@ -0,0 +1,67 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +option_15 = FilenameOption(name="name", doc="name", default="/etc/file3") +option_14 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_13 = OptionDescription(name="file3", doc="file3", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file3") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16]) +optiondescription_32.impl_set_information('type', "service") +optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"})) +optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_21 = FilenameOption(name="name", doc="name", default="/etc/file") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "file") +option_24 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_23 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23]) +optiondescription_22.impl_set_information('engine', "jinja2") +optiondescription_22.impl_set_information('source', "file2") +option_27 = FilenameOption(name="name", doc="name", default="/etc/file3") +option_26 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_25 = OptionDescription(name="file3", doc="file3", children=[option_27, option_26]) +optiondescription_25.impl_set_information('source', "file3") +optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25]) +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_28 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33]) diff --git a/tests/dictionaries/01base_file_include/tiramisu/base.py b/tests/dictionaries/01base_file_include/tiramisu/base.py index bcd47e871..a9acf95e0 100644 --- a/tests/dictionaries/01base_file_include/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/01base_file_include/tiramisu/multi.py b/tests/dictionaries/01base_file_include/tiramisu/multi.py new file mode 100644 index 000000000..35f62a28c --- /dev/null +++ b/tests/dictionaries/01base_file_include/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/file") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "file") +option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "file2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/01base_file_include_content/tiramisu/base.py b/tests/dictionaries/01base_file_include_content/tiramisu/base.py index d4aeaed17..f5e417b4d 100644 --- a/tests/dictionaries/01base_file_include_content/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include_content/tiramisu/base.py @@ -2,38 +2,43 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +option_13 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15]) -option_13.impl_set_information('included', "content") -option_13.impl_set_information('source', "incfile") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_11 = OptionDescription(name="incfile", doc="incfile", children=[option_13, option_12]) +optiondescription_11.impl_set_information('included', "content") +optiondescription_11.impl_set_information('source', "incfile") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/01base_file_include_content/tiramisu/multi.py b/tests/dictionaries/01base_file_include_content/tiramisu/multi.py new file mode 100644 index 000000000..3c3fbd45f --- /dev/null +++ b/tests/dictionaries/01base_file_include_content/tiramisu/multi.py @@ -0,0 +1,69 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +option_15 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="incfile", doc="incfile", children=[option_15, option_14]) +optiondescription_13.impl_set_information('included', "content") +optiondescription_13.impl_set_information('source', "incfile") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16]) +optiondescription_32.impl_set_information('type', "service") +optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"})) +optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_21 = FilenameOption(name="name", doc="name", default="/etc/file") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "file") +option_24 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_23 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23]) +optiondescription_22.impl_set_information('engine', "jinja2") +optiondescription_22.impl_set_information('source', "file2") +option_27 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") +option_26 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_25 = OptionDescription(name="incfile", doc="incfile", children=[option_27, option_26]) +optiondescription_25.impl_set_information('included', "content") +optiondescription_25.impl_set_information('source', "incfile") +optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25]) +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_28 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33]) diff --git a/tests/dictionaries/01base_file_include_name/tiramisu/base.py b/tests/dictionaries/01base_file_include_name/tiramisu/base.py index 961880f92..577a2dbff 100644 --- a/tests/dictionaries/01base_file_include_name/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include_name/tiramisu/base.py @@ -2,38 +2,43 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +option_13 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15]) -option_13.impl_set_information('included', "name") -option_13.impl_set_information('source', "incfile") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_11 = OptionDescription(name="incfile", doc="incfile", children=[option_13, option_12]) +optiondescription_11.impl_set_information('included', "name") +optiondescription_11.impl_set_information('source', "incfile") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/01base_file_include_name/tiramisu/multi.py b/tests/dictionaries/01base_file_include_name/tiramisu/multi.py new file mode 100644 index 000000000..9dcb184f2 --- /dev/null +++ b/tests/dictionaries/01base_file_include_name/tiramisu/multi.py @@ -0,0 +1,69 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +option_15 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="incfile", doc="incfile", children=[option_15, option_14]) +optiondescription_13.impl_set_information('included', "name") +optiondescription_13.impl_set_information('source', "incfile") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16]) +optiondescription_32.impl_set_information('type', "service") +optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"})) +optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_21 = FilenameOption(name="name", doc="name", default="/etc/file") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "file") +option_24 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_23 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23]) +optiondescription_22.impl_set_information('engine', "jinja2") +optiondescription_22.impl_set_information('source', "file2") +option_27 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") +option_26 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_25 = OptionDescription(name="incfile", doc="incfile", children=[option_27, option_26]) +optiondescription_25.impl_set_information('included', "name") +optiondescription_25.impl_set_information('source', "incfile") +optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25]) +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_28 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33]) diff --git a/tests/dictionaries/01base_file_owner/tiramisu/base.py b/tests/dictionaries/01base_file_owner/tiramisu/base.py index f7d15a5a5..14686b0bd 100644 --- a/tests/dictionaries/01base_file_owner/tiramisu/base.py +++ b/tests/dictionaries/01base_file_owner/tiramisu/base.py @@ -2,37 +2,42 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = UsernameOption(name="group", doc="group", default="nobody") -option_9 = FilenameOption(name="name", doc="name", default="/etc/file") -option_10 = UsernameOption(name="owner", doc="owner", default="nobody") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = UsernameOption(name="group", doc="group", default="nobody") +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = UsernameOption(name="owner", doc="owner", default="nobody") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_8, option_9, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_12 = UsernameOption(name="group", doc="group", default="nobody") +option_13 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_14 = UsernameOption(name="owner", doc="owner", default="nobody") option_11 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11]) -option_7.impl_set_information('source', "file") -option_13 = UsernameOption(name="group", doc="group", default="nobody") -option_14 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_15 = UsernameOption(name="owner", doc="owner", default="nobody") -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="file2", doc="file2", children=[option_13, option_14, option_15, option_16]) -option_12.impl_set_information('engine', "jinja2") -option_12.impl_set_information('source', "file2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_12]) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_18 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_17, option_18]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_13, option_14, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_10]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_15 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_15]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_16, optiondescription_17]) diff --git a/tests/dictionaries/01base_file_owner/tiramisu/multi.py b/tests/dictionaries/01base_file_owner/tiramisu/multi.py new file mode 100644 index 000000000..8b83e6062 --- /dev/null +++ b/tests/dictionaries/01base_file_owner/tiramisu/multi.py @@ -0,0 +1,67 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_32 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = UsernameOption(name="group", doc="group", default="nobody") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file") +option_11 = UsernameOption(name="owner", doc="owner", default="nobody") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_14 = UsernameOption(name="group", doc="group", default="nobody") +option_15 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_16 = UsernameOption(name="owner", doc="owner", default="nobody") +option_13 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_12 = OptionDescription(name="file2", doc="file2", children=[option_14, option_15, option_16, option_13]) +optiondescription_12.impl_set_information('engine', "jinja2") +optiondescription_12.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_12]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_34 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_17]) +optiondescription_34.impl_set_information('type', "service") +optiondescription_33 = OptionDescription(name="services", doc="services", children=[optiondescription_34], properties=frozenset({"hidden"})) +optiondescription_31 = OptionDescription(name="1", doc="1", children=[optiondescription_32, optiondescription_33]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_36 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_22 = UsernameOption(name="group", doc="group", default="nobody") +option_23 = FilenameOption(name="name", doc="name", default="/etc/file") +option_24 = UsernameOption(name="owner", doc="owner", default="nobody") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="file", doc="file", children=[option_22, option_23, option_24, option_21]) +optiondescription_20.impl_set_information('source', "file") +option_27 = UsernameOption(name="group", doc="group", default="nobody") +option_28 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_29 = UsernameOption(name="owner", doc="owner", default="nobody") +option_26 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_25 = OptionDescription(name="file2", doc="file2", children=[option_27, option_28, option_29, option_26]) +optiondescription_25.impl_set_information('engine', "jinja2") +optiondescription_25.impl_set_information('source', "file2") +optiondescription_19 = OptionDescription(name="files", doc="files", children=[optiondescription_20, optiondescription_25]) +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_30 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_38 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_19, option_18, option_30]) +optiondescription_38.impl_set_information('type', "service") +optiondescription_37 = OptionDescription(name="services", doc="services", children=[optiondescription_38], properties=frozenset({"hidden"})) +optiondescription_35 = OptionDescription(name="2", doc="2", children=[optiondescription_36, optiondescription_37]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_31, optiondescription_35]) diff --git a/tests/dictionaries/01base_file_owner_variable/tiramisu/base.py b/tests/dictionaries/01base_file_owner_variable/tiramisu/base.py index 17085b4ed..06bd03888 100644 --- a/tests/dictionaries/01base_file_owner_variable/tiramisu/base.py +++ b/tests/dictionaries/01base_file_owner_variable/tiramisu/base.py @@ -2,39 +2,44 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"})) -option_5 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = SymLinkOption(name="group", opt=option_5) -option_11 = FilenameOption(name="name", doc="name", default="/etc/file") -option_12 = SymLinkOption(name="owner", opt=option_4) +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"})) +option_4 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = SymLinkOption(name="group", opt=option_4) +option_10 = FilenameOption(name="name", doc="name", default="/etc/file") +option_11 = SymLinkOption(name="owner", opt=option_3) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_14 = SymLinkOption(name="group", opt=option_4) +option_15 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_16 = SymLinkOption(name="owner", opt=option_3) option_13 = BoolOption(name="activate", doc="activate", default=True) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13]) -option_9.impl_set_information('source', "file") -option_15 = SymLinkOption(name="group", opt=option_5) -option_16 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_17 = SymLinkOption(name="owner", opt=option_4) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_14 = OptionDescription(name="file2", doc="file2", children=[option_15, option_16, option_17, option_18]) -option_14.impl_set_information('engine', "jinja2") -option_14.impl_set_information('source', "file2") -option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_14]) -option_19 = BoolOption(name="activate", doc="activate", default=True) -option_20 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_19, option_20]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +optiondescription_12 = OptionDescription(name="file2", doc="file2", children=[option_14, option_15, option_16, option_13]) +optiondescription_12.impl_set_information('engine', "jinja2") +optiondescription_12.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_12]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_17]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_18, optiondescription_19]) diff --git a/tests/dictionaries/01base_file_owner_variable/tiramisu/multi.py b/tests/dictionaries/01base_file_owner_variable/tiramisu/multi.py new file mode 100644 index 000000000..13822037f --- /dev/null +++ b/tests/dictionaries/01base_file_owner_variable/tiramisu/multi.py @@ -0,0 +1,71 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"})) +option_4 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_36 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = SymLinkOption(name="group", opt=option_4) +option_14 = FilenameOption(name="name", doc="name", default="/etc/file") +option_15 = SymLinkOption(name="owner", opt=option_3) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_14, option_15, option_12]) +optiondescription_11.impl_set_information('source', "file") +option_18 = SymLinkOption(name="group", opt=option_4) +option_19 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_20 = SymLinkOption(name="owner", opt=option_3) +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="file2", doc="file2", children=[option_18, option_19, option_20, option_17]) +optiondescription_16.impl_set_information('engine', "jinja2") +optiondescription_16.impl_set_information('source', "file2") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11, optiondescription_16]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_21 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_38 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_21]) +optiondescription_38.impl_set_information('type', "service") +optiondescription_37 = OptionDescription(name="services", doc="services", children=[optiondescription_38], properties=frozenset({"hidden"})) +optiondescription_35 = OptionDescription(name="1", doc="1", children=[optiondescription_36, optiondescription_37]) +option_6 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"})) +option_8 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_40 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_26 = SymLinkOption(name="group", opt=option_8) +option_27 = FilenameOption(name="name", doc="name", default="/etc/file") +option_28 = SymLinkOption(name="owner", opt=option_7) +option_25 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_24 = OptionDescription(name="file", doc="file", children=[option_26, option_27, option_28, option_25]) +optiondescription_24.impl_set_information('source', "file") +option_31 = SymLinkOption(name="group", opt=option_8) +option_32 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_33 = SymLinkOption(name="owner", opt=option_7) +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="file2", doc="file2", children=[option_31, option_32, option_33, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "file2") +optiondescription_23 = OptionDescription(name="files", doc="files", children=[optiondescription_24, optiondescription_29]) +option_22 = BoolOption(name="activate", doc="activate", default=True) +option_34 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_23, option_22, option_34]) +optiondescription_42.impl_set_information('type', "service") +optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"})) +optiondescription_39 = OptionDescription(name="2", doc="2", children=[optiondescription_40, optiondescription_41]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_35, optiondescription_39]) diff --git a/tests/dictionaries/01base_file_patch/tiramisu/base.py b/tests/dictionaries/01base_file_patch/tiramisu/base.py index bcd47e871..a9acf95e0 100644 --- a/tests/dictionaries/01base_file_patch/tiramisu/base.py +++ b/tests/dictionaries/01base_file_patch/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/01base_file_patch/tiramisu/multi.py b/tests/dictionaries/01base_file_patch/tiramisu/multi.py new file mode 100644 index 000000000..35f62a28c --- /dev/null +++ b/tests/dictionaries/01base_file_patch/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/file") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "file") +option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "file2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/base.py b/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/base.py index bcd47e871..a9acf95e0 100644 --- a/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/base.py +++ b/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +option_10 = FilenameOption(name="name", doc="name", default="/etc/file2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "file2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "file2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/multi.py b/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/multi.py new file mode 100644 index 000000000..35f62a28c --- /dev/null +++ b/tests/dictionaries/01base_file_tmpfile_dest_dir/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +option_12 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/file") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "file") +option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "file2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/01base_file_utfchar/tiramisu/base.py b/tests/dictionaries/01base_file_utfchar/tiramisu/base.py index 81921e350..ef69a9376 100644 --- a/tests/dictionaries/01base_file_utfchar/tiramisu/base.py +++ b/tests/dictionaries/01base_file_utfchar/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel") +option_10 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9]) -option_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel") -option_11 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/01base_file_utfchar/tiramisu/multi.py b/tests/dictionaries/01base_file_utfchar/tiramisu/multi.py new file mode 100644 index 000000000..915411982 --- /dev/null +++ b/tests/dictionaries/01base_file_utfchar/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel") +option_12 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel") +option_21 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/01base_float/tiramisu/base.py b/tests/dictionaries/01base_float/tiramisu/base.py index c773cbd95..47a9222cd 100644 --- a/tests/dictionaries/01base_float/tiramisu/base.py +++ b/tests/dictionaries/01base_float/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) -option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01base_float/tiramisu/multi.py b/tests/dictionaries/01base_float/tiramisu/multi.py new file mode 100644 index 000000000..914fda409 --- /dev/null +++ b/tests/dictionaries/01base_float/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_6 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01base_help_quote/tiramisu/base.py b/tests/dictionaries/01base_help_quote/tiramisu/base.py index 85134eeea..1aaf709ce 100644 --- a/tests/dictionaries/01base_help_quote/tiramisu/base.py +++ b/tests/dictionaries/01base_help_quote/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"})) -option_3.impl_set_information('help', "message with '") -option_4 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"})) -option_4.impl_set_information('help', "message with \"") -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"})) +option_2.impl_set_information('help', "message with '") +option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"})) +option_3.impl_set_information('help', "message with \"") +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01base_help_quote/tiramisu/multi.py b/tests/dictionaries/01base_help_quote/tiramisu/multi.py new file mode 100644 index 000000000..2cbea6e27 --- /dev/null +++ b/tests/dictionaries/01base_help_quote/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"})) +option_2.impl_set_information('help', "message with '") +option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"})) +option_3.impl_set_information('help', "message with \"") +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"})) +option_5.impl_set_information('help', "message with '") +option_6 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"})) +option_6.impl_set_information('help', "message with \"") +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01base_multi/tiramisu/base.py b/tests/dictionaries/01base_multi/tiramisu/base.py index 5d8e715c5..f0afc8071 100644 --- a/tests/dictionaries/01base_multi/tiramisu/base.py +++ b/tests/dictionaries/01base_multi/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_multi/tiramisu/multi.py b/tests/dictionaries/01base_multi/tiramisu/multi.py new file mode 100644 index 000000000..131218f00 --- /dev/null +++ b/tests/dictionaries/01base_multi/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_multi_notuniq/00-base.xml b/tests/dictionaries/01base_multi_notuniq/00-base.xml new file mode 100644 index 000000000..357f16593 --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/00-base.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/dictionaries/01base_multi_notuniq/__init__.py b/tests/dictionaries/01base_multi_notuniq/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_multi_notuniq/makedict/after.json b/tests/dictionaries/01base_multi_notuniq/makedict/after.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/makedict/after.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_notuniq/makedict/base.json b/tests/dictionaries/01base_multi_notuniq/makedict/base.json new file mode 100644 index 000000000..feedadc62 --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/makedict/base.json @@ -0,0 +1,5 @@ +{ + "rougail.general.mode_conteneur_actif": [ + "non" + ] +} diff --git a/tests/dictionaries/01base_multi_notuniq/makedict/before.json b/tests/dictionaries/01base_multi_notuniq/makedict/before.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/makedict/before.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_notuniq/tiramisu/base.py b/tests/dictionaries/01base_multi_notuniq/tiramisu/base.py new file mode 100644 index 000000000..f43ac1b03 --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/tiramisu/base.py @@ -0,0 +1,24 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_multi_notuniq/tiramisu/multi.py b/tests/dictionaries/01base_multi_notuniq/tiramisu/multi.py new file mode 100644 index 000000000..e1a3dd5ec --- /dev/null +++ b/tests/dictionaries/01base_multi_notuniq/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_multi_uniq/00-base.xml b/tests/dictionaries/01base_multi_uniq/00-base.xml new file mode 100644 index 000000000..baded8a93 --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/00-base.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/dictionaries/01base_multi_uniq/__init__.py b/tests/dictionaries/01base_multi_uniq/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_multi_uniq/makedict/after.json b/tests/dictionaries/01base_multi_uniq/makedict/after.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/makedict/after.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_uniq/makedict/base.json b/tests/dictionaries/01base_multi_uniq/makedict/base.json new file mode 100644 index 000000000..feedadc62 --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/makedict/base.json @@ -0,0 +1,5 @@ +{ + "rougail.general.mode_conteneur_actif": [ + "non" + ] +} diff --git a/tests/dictionaries/01base_multi_uniq/makedict/before.json b/tests/dictionaries/01base_multi_uniq/makedict/before.json new file mode 100644 index 000000000..cfec4b1fc --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/makedict/before.json @@ -0,0 +1,8 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": [ + "non" + ] + } +} diff --git a/tests/dictionaries/01base_multi_uniq/tiramisu/base.py b/tests/dictionaries/01base_multi_uniq/tiramisu/base.py new file mode 100644 index 000000000..6b0f864cd --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/tiramisu/base.py @@ -0,0 +1,24 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_multi_uniq/tiramisu/multi.py b/tests/dictionaries/01base_multi_uniq/tiramisu/multi.py new file mode 100644 index 000000000..e0e91968e --- /dev/null +++ b/tests/dictionaries/01base_multi_uniq/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_provider/tiramisu/base.py b/tests/dictionaries/01base_provider/tiramisu/base.py index 225b941d7..b06108930 100644 --- a/tests/dictionaries/01base_provider/tiramisu/base.py +++ b/tests/dictionaries/01base_provider/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) -option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) option_0.impl_set_information('provider:float', "rougail.general.float") diff --git a/tests/dictionaries/01base_provider/tiramisu/multi.py b/tests/dictionaries/01base_provider/tiramisu/multi.py new file mode 100644 index 000000000..2836bd71c --- /dev/null +++ b/tests/dictionaries/01base_provider/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +optiondescription_7.impl_set_information('provider:float', "rougail.general.float") +option_5 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"})) +option_6 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +optiondescription_9.impl_set_information('provider:float', "rougail.general.float") +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01base_provider_extra/00-base.xml b/tests/dictionaries/01base_provider_extra/00-base.xml new file mode 100644 index 000000000..2bf77cab2 --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/00-base.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/dictionaries/01base_provider_extra/__init__.py b/tests/dictionaries/01base_provider_extra/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/01base_provider_extra/extra_dirs/extra/00-base.xml b/tests/dictionaries/01base_provider_extra/extra_dirs/extra/00-base.xml new file mode 100644 index 000000000..03d39724d --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/extra_dirs/extra/00-base.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/dictionaries/01base_provider_extra/makedict/after.json b/tests/dictionaries/01base_provider_extra/makedict/after.json new file mode 100644 index 000000000..773f9f708 --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/makedict/after.json @@ -0,0 +1,10 @@ +{ + "rougail.float": { + "owner": "default", + "value": null + }, + "extra.example.description": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/01base_provider_extra/makedict/base.json b/tests/dictionaries/01base_provider_extra/makedict/base.json new file mode 100644 index 000000000..56f363b4e --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/makedict/base.json @@ -0,0 +1,4 @@ +{ + "rougail.float": null, + "extra.example.description": null +} diff --git a/tests/dictionaries/01base_provider_extra/makedict/before.json b/tests/dictionaries/01base_provider_extra/makedict/before.json new file mode 100644 index 000000000..773f9f708 --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/makedict/before.json @@ -0,0 +1,10 @@ +{ + "rougail.float": { + "owner": "default", + "value": null + }, + "extra.example.description": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/01base_provider_extra/tiramisu/base.py b/tests/dictionaries/01base_provider_extra/tiramisu/base.py new file mode 100644 index 000000000..ca604d9d8 --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/tiramisu/base.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = FloatOption(name="float", doc="Description", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = StrOption(name="description", doc="description", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="example", doc="example", children=[option_3], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="extra", doc="extra", children=[optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) +option_0.impl_set_information('provider:example', "extra.example.description") diff --git a/tests/dictionaries/01base_provider_extra/tiramisu/multi.py b/tests/dictionaries/01base_provider_extra/tiramisu/multi.py new file mode 100644 index 000000000..cf767723e --- /dev/null +++ b/tests/dictionaries/01base_provider_extra/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = FloatOption(name="float", doc="Description", properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = StrOption(name="description", doc="description", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="example", doc="example", children=[option_3], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="extra", doc="extra", children=[optiondescription_2]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +optiondescription_7.impl_set_information('provider:example', "extra.example.description") +option_4 = FloatOption(name="float", doc="Description", properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[option_4]) +option_6 = StrOption(name="description", doc="description", properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="example", doc="example", children=[option_6], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="extra", doc="extra", children=[optiondescription_5]) +optiondescription_10 = OptionDescription(name="2", doc="2", children=[optiondescription_11, optiondescription_12]) +optiondescription_10.impl_set_information('provider:example', "extra.example.description") +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_10]) diff --git a/tests/dictionaries/01base_provider_hidden/tiramisu/base.py b/tests/dictionaries/01base_provider_hidden/tiramisu/base.py index 56a4832b0..d4bb7bc11 100644 --- a/tests/dictionaries/01base_provider_hidden/tiramisu/base.py +++ b/tests/dictionaries/01base_provider_hidden/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"hidden", "mandatory", "normal"})) -option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"hidden", "mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) option_0.impl_set_information('provider:float', "rougail.general.float") diff --git a/tests/dictionaries/01base_provider_hidden/tiramisu/multi.py b/tests/dictionaries/01base_provider_hidden/tiramisu/multi.py new file mode 100644 index 000000000..fae41f13a --- /dev/null +++ b/tests/dictionaries/01base_provider_hidden/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"hidden", "mandatory", "normal"})) +option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +optiondescription_7.impl_set_information('provider:float', "rougail.general.float") +option_5 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"hidden", "mandatory", "normal"})) +option_6 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +optiondescription_9.impl_set_information('provider:float', "rougail.general.float") +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01base_value_doublequote/tiramisu/base.py b/tests/dictionaries/01base_value_doublequote/tiramisu/base.py index 88212fb35..fd3e4d19e 100644 --- a/tests/dictionaries/01base_value_doublequote/tiramisu/base.py +++ b/tests/dictionaries/01base_value_doublequote/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_doublequote/tiramisu/multi.py b/tests/dictionaries/01base_value_doublequote/tiramisu/multi.py new file mode 100644 index 000000000..cea24ad60 --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_doublequote2/tiramisu/base.py b/tests/dictionaries/01base_value_doublequote2/tiramisu/base.py index 37c4fdb66..bfcd913a8 100644 --- a/tests/dictionaries/01base_value_doublequote2/tiramisu/base.py +++ b/tests/dictionaries/01base_value_doublequote2/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_doublequote2/tiramisu/multi.py b/tests/dictionaries/01base_value_doublequote2/tiramisu/multi.py new file mode 100644 index 000000000..cde16db27 --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote2/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_doublequote3/tiramisu/base.py b/tests/dictionaries/01base_value_doublequote3/tiramisu/base.py index 08d13dc24..12e9298cb 100644 --- a/tests/dictionaries/01base_value_doublequote3/tiramisu/base.py +++ b/tests/dictionaries/01base_value_doublequote3/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\\\"\\'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\\\"\\'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_doublequote3/tiramisu/multi.py b/tests/dictionaries/01base_value_doublequote3/tiramisu/multi.py new file mode 100644 index 000000000..88af03ab4 --- /dev/null +++ b/tests/dictionaries/01base_value_doublequote3/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\\\"\\'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\\\"\\'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_multi_doublequote/tiramisu/base.py b/tests/dictionaries/01base_value_multi_doublequote/tiramisu/base.py index 56b8c1497..4448a3d57 100644 --- a/tests/dictionaries/01base_value_multi_doublequote/tiramisu/base.py +++ b/tests/dictionaries/01base_value_multi_doublequote/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote"'], default_multi="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote"'], default_multi="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_multi_doublequote/tiramisu/multi.py b/tests/dictionaries/01base_value_multi_doublequote/tiramisu/multi.py new file mode 100644 index 000000000..7cc314c7f --- /dev/null +++ b/tests/dictionaries/01base_value_multi_doublequote/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote"'], default_multi="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote"'], default_multi="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/base.py b/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/base.py index e1876be84..c78aaabc6 100644 --- a/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/base.py +++ b/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote\'"'], default_multi="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote\'"'], default_multi="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/multi.py b/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/multi.py new file mode 100644 index 000000000..8661e9d8f --- /dev/null +++ b/tests/dictionaries/01base_value_multi_doublequote2/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote\'"'], default_multi="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote\'"'], default_multi="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_multi_quote/tiramisu/base.py b/tests/dictionaries/01base_value_multi_quote/tiramisu/base.py index b85f078f2..0950b9bd2 100644 --- a/tests/dictionaries/01base_value_multi_quote/tiramisu/base.py +++ b/tests/dictionaries/01base_value_multi_quote/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_multi_quote/tiramisu/multi.py b/tests/dictionaries/01base_value_multi_quote/tiramisu/multi.py new file mode 100644 index 000000000..13a0396ed --- /dev/null +++ b/tests/dictionaries/01base_value_multi_quote/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_value_quote/tiramisu/base.py b/tests/dictionaries/01base_value_quote/tiramisu/base.py index ae5de227d..0af701068 100644 --- a/tests/dictionaries/01base_value_quote/tiramisu/base.py +++ b/tests/dictionaries/01base_value_quote/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_value_quote/tiramisu/multi.py b/tests/dictionaries/01base_value_quote/tiramisu/multi.py new file mode 100644 index 000000000..d42c5a703 --- /dev/null +++ b/tests/dictionaries/01base_value_quote/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01base_var_name_same_family/tiramisu/base.py b/tests/dictionaries/01base_var_name_same_family/tiramisu/base.py index 71046ff4d..cfda617e0 100644 --- a/tests/dictionaries/01base_var_name_same_family/tiramisu/base.py +++ b/tests/dictionaries/01base_var_name_same_family/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="general", doc="description", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="general", doc="description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01base_var_name_same_family/tiramisu/multi.py b/tests/dictionaries/01base_var_name_same_family/tiramisu/multi.py new file mode 100644 index 000000000..290affa69 --- /dev/null +++ b/tests/dictionaries/01base_var_name_same_family/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="general", doc="description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="general", doc="description", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01boolean_no_mandatory/tiramisu/base.py b/tests/dictionaries/01boolean_no_mandatory/tiramisu/base.py index 9f573b6a5..3d495f9f8 100644 --- a/tests/dictionaries/01boolean_no_mandatory/tiramisu/base.py +++ b/tests/dictionaries/01boolean_no_mandatory/tiramisu/base.py @@ -2,18 +2,22 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="my_variable", doc="my_variable", default=True, properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="my_variable", doc="my_variable", default=True, properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/dictionaries/01boolean_no_mandatory/tiramisu/multi.py b/tests/dictionaries/01boolean_no_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..f1a75e4ba --- /dev/null +++ b/tests/dictionaries/01boolean_no_mandatory/tiramisu/multi.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="my_variable", doc="my_variable", default=True, properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +optiondescription_3 = OptionDescription(name="1", doc="1", children=[optiondescription_4]) +option_2 = BoolOption(name="my_variable", doc="my_variable", default=True, properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3, optiondescription_5]) diff --git a/tests/dictionaries/01family_description/tiramisu/base.py b/tests/dictionaries/01family_description/tiramisu/base.py index a502fc5bf..a8086372c 100644 --- a/tests/dictionaries/01family_description/tiramisu/base.py +++ b/tests/dictionaries/01family_description/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="Other description", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="Other description", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01family_description/tiramisu/multi.py b/tests/dictionaries/01family_description/tiramisu/multi.py new file mode 100644 index 000000000..7cd5792d8 --- /dev/null +++ b/tests/dictionaries/01family_description/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="Other description", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="Other description", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01fill_autofreeze/tiramisu/base.py b/tests/dictionaries/01fill_autofreeze/tiramisu/base.py index 25e47cb24..2da63cffc 100644 --- a/tests/dictionaries/01fill_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01fill_autofreeze/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) -option_2 = StrOption(name="my_var1", doc="my_var1", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="my_var1", doc="my_var1", default=Calculation(func.calc_val, Params((ParamOption(option_2)))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_autofreeze/tiramisu/multi.py b/tests/dictionaries/01fill_autofreeze/tiramisu/multi.py new file mode 100644 index 000000000..5cd131ba7 --- /dev/null +++ b/tests/dictionaries/01fill_autofreeze/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_1 = StrOption(name="my_var1", doc="my_var1", default=Calculation(func.calc_val, Params((ParamOption(option_2)))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +option_6 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="my_var1", doc="my_var1", default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, option_5, option_6]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_autosave/tiramisu/base.py b/tests/dictionaries/01fill_autosave/tiramisu/base.py index 5eb739b5f..8180722ce 100644 --- a/tests/dictionaries/01fill_autosave/tiramisu/base.py +++ b/tests/dictionaries/01fill_autosave/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"basic", "force_store_value"})) -option_3 = OptionDescription(name="general", doc="general", children=[option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"basic", "force_store_value"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/01fill_autosave/tiramisu/multi.py b/tests/dictionaries/01fill_autosave/tiramisu/multi.py new file mode 100644 index 000000000..233eaac83 --- /dev/null +++ b/tests/dictionaries/01fill_autosave/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"basic", "force_store_value"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_8)))), properties=frozenset({"basic", "force_store_value"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_5, optiondescription_6]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/01fill_base/tiramisu/base.py b/tests/dictionaries/01fill_base/tiramisu/base.py index 5cfeb305d..95b7c93a5 100644 --- a/tests/dictionaries/01fill_base/tiramisu/base.py +++ b/tests/dictionaries/01fill_base/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_base/tiramisu/multi.py b/tests/dictionaries/01fill_base/tiramisu/multi.py new file mode 100644 index 000000000..ad493c39e --- /dev/null +++ b/tests/dictionaries/01fill_base/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_mandatory/tiramisu/base.py b/tests/dictionaries/01fill_mandatory/tiramisu/base.py index 66e0c131f..86c4119a4 100644 --- a/tests/dictionaries/01fill_mandatory/tiramisu/base.py +++ b/tests/dictionaries/01fill_mandatory/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"basic"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_mandatory/tiramisu/multi.py b/tests/dictionaries/01fill_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..32bcca8e6 --- /dev/null +++ b/tests/dictionaries/01fill_mandatory/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"expert", "mandatory"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_number/tiramisu/base.py b/tests/dictionaries/01fill_number/tiramisu/base.py index f9fa43252..7e76a857c 100644 --- a/tests/dictionaries/01fill_number/tiramisu/base.py +++ b/tests/dictionaries/01fill_number/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = IntOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue(3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = IntOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue(3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_number/tiramisu/multi.py b/tests/dictionaries/01fill_number/tiramisu/multi.py new file mode 100644 index 000000000..39c34ff87 --- /dev/null +++ b/tests/dictionaries/01fill_number/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = IntOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue(3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = IntOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue(3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_only_optional/tiramisu/base.py b/tests/dictionaries/01fill_only_optional/tiramisu/base.py index 45dd37ed1..4d1b839e0 100644 --- a/tests/dictionaries/01fill_only_optional/tiramisu/base.py +++ b/tests/dictionaries/01fill_only_optional/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_only_optional/tiramisu/multi.py b/tests/dictionaries/01fill_only_optional/tiramisu/multi.py new file mode 100644 index 000000000..537e9e5a7 --- /dev/null +++ b/tests/dictionaries/01fill_only_optional/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_optional/tiramisu/base.py b/tests/dictionaries/01fill_optional/tiramisu/base.py index 60db379ef..482ee4222 100644 --- a/tests/dictionaries/01fill_optional/tiramisu/base.py +++ b/tests/dictionaries/01fill_optional/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/01fill_optional/tiramisu/multi.py b/tests/dictionaries/01fill_optional/tiramisu/multi.py new file mode 100644 index 000000000..403b41801 --- /dev/null +++ b/tests/dictionaries/01fill_optional/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/01fill_quote/tiramisu/base.py b/tests/dictionaries/01fill_quote/tiramisu/base.py index 3689f2640..1b9ed09e8 100644 --- a/tests/dictionaries/01fill_quote/tiramisu/base.py +++ b/tests/dictionaries/01fill_quote/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote'")))), properties=frozenset({"normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"")))), properties=frozenset({"normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"'")))), properties=frozenset({"normal"})) -option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"\\'")))), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote'")))), properties=frozenset({"normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"")))), properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"'")))), properties=frozenset({"normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"\\'")))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/01fill_quote/tiramisu/multi.py b/tests/dictionaries/01fill_quote/tiramisu/multi.py new file mode 100644 index 000000000..efb3edaa4 --- /dev/null +++ b/tests/dictionaries/01fill_quote/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote'")))), properties=frozenset({"normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"")))), properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"'")))), properties=frozenset({"normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"\\'")))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote'")))), properties=frozenset({"normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"")))), properties=frozenset({"normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"'")))), properties=frozenset({"normal"})) +option_10 = StrOption(name="mode_conteneur_actif3", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"\\'")))), properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/01fill_target_optional/tiramisu/base.py b/tests/dictionaries/01fill_target_optional/tiramisu/base.py index c6b1eb1da..5d4a83756 100644 --- a/tests/dictionaries/01fill_target_optional/tiramisu/base.py +++ b/tests/dictionaries/01fill_target_optional/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01fill_target_optional/tiramisu/multi.py b/tests/dictionaries/01fill_target_optional/tiramisu/multi.py new file mode 100644 index 000000000..9e57525a8 --- /dev/null +++ b/tests/dictionaries/01fill_target_optional/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py index 191bf4bad..552ab1ec7 100644 --- a/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/multi.py b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/multi.py new file mode 100644 index 000000000..cf73d70cc --- /dev/null +++ b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01test/tiramisu/base.py b/tests/dictionaries/01test/tiramisu/base.py index 0348b1918..1757cd85f 100644 --- a/tests/dictionaries/01test/tiramisu/base.py +++ b/tests/dictionaries/01test/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_3.impl_set_information('test', ('test',)) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test',)) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01test/tiramisu/multi.py b/tests/dictionaries/01test/tiramisu/multi.py new file mode 100644 index 000000000..49130a180 --- /dev/null +++ b/tests/dictionaries/01test/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test',)) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_4.impl_set_information('test', ('test',)) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01test_multi/tiramisu/base.py b/tests/dictionaries/01test_multi/tiramisu/base.py index eb0bab8c2..273dc127c 100644 --- a/tests/dictionaries/01test_multi/tiramisu/base.py +++ b/tests/dictionaries/01test_multi/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_3.impl_set_information('test', ('test1', 'test2')) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test1', 'test2')) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01test_multi/tiramisu/multi.py b/tests/dictionaries/01test_multi/tiramisu/multi.py new file mode 100644 index 000000000..7b39478a9 --- /dev/null +++ b/tests/dictionaries/01test_multi/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test1', 'test2')) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_4.impl_set_information('test', ('test1', 'test2')) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01test_multi_none/tiramisu/base.py b/tests/dictionaries/01test_multi_none/tiramisu/base.py index 6f53fdc78..0585be5ec 100644 --- a/tests/dictionaries/01test_multi_none/tiramisu/base.py +++ b/tests/dictionaries/01test_multi_none/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_3.impl_set_information('test', (None, 'test1', 'test2')) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', (None, 'test1', 'test2')) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01test_multi_none/tiramisu/multi.py b/tests/dictionaries/01test_multi_none/tiramisu/multi.py new file mode 100644 index 000000000..85462c365 --- /dev/null +++ b/tests/dictionaries/01test_multi_none/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', (None, 'test1', 'test2')) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_4.impl_set_information('test', (None, 'test1', 'test2')) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01test_redefine/tiramisu/base.py b/tests/dictionaries/01test_redefine/tiramisu/base.py index af5de5037..d68521992 100644 --- a/tests/dictionaries/01test_redefine/tiramisu/base.py +++ b/tests/dictionaries/01test_redefine/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_3.impl_set_information('test', ('test1',)) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test1',)) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01test_redefine/tiramisu/multi.py b/tests/dictionaries/01test_redefine/tiramisu/multi.py new file mode 100644 index 000000000..699cf9270 --- /dev/null +++ b/tests/dictionaries/01test_redefine/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_2.impl_set_information('test', ('test1',)) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +option_4.impl_set_information('test', ('test1',)) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/01test_redefine_base/tiramisu/base.py b/tests/dictionaries/01test_redefine_base/tiramisu/base.py index 5640205d0..630d18971 100644 --- a/tests/dictionaries/01test_redefine_base/tiramisu/base.py +++ b/tests/dictionaries/01test_redefine_base/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) -option_2.impl_set_information('test', ('test1',)) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +option_1.impl_set_information('test', ('test1',)) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/dictionaries/01test_redefine_base/tiramisu/multi.py b/tests/dictionaries/01test_redefine_base/tiramisu/multi.py new file mode 100644 index 000000000..5b9ec8fb7 --- /dev/null +++ b/tests/dictionaries/01test_redefine_base/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +option_1.impl_set_information('test', ('test1',)) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +optiondescription_3 = OptionDescription(name="1", doc="1", children=[optiondescription_4]) +option_2 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +option_2.impl_set_information('test', ('test1',)) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3, optiondescription_5]) diff --git a/tests/dictionaries/01test_redefine_remove/tiramisu/base.py b/tests/dictionaries/01test_redefine_remove/tiramisu/base.py index 1af8dc2c6..faef620ed 100644 --- a/tests/dictionaries/01test_redefine_remove/tiramisu/base.py +++ b/tests/dictionaries/01test_redefine_remove/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/01test_redefine_remove/tiramisu/multi.py b/tests/dictionaries/01test_redefine_remove/tiramisu/multi.py new file mode 100644 index 000000000..5f55e7c53 --- /dev/null +++ b/tests/dictionaries/01test_redefine_remove/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py index c57284906..088aef96e 100644 --- a/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py +++ b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_3 = OptionDescription(name="general", doc="général", children=[option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/multi.py b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/multi.py new file mode 100644 index 000000000..d7162942a --- /dev/null +++ b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7, option_8], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_5, optiondescription_6]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/02fill_multi_calc_val/tiramisu/base.py b/tests/dictionaries/02fill_multi_calc_val/tiramisu/base.py index 1111932ff..8ecc9b37b 100644 --- a/tests/dictionaries/02fill_multi_calc_val/tiramisu/base.py +++ b/tests/dictionaries/02fill_multi_calc_val/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="var1", doc="var1", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_2)), kwargs={'multi': ParamValue(True)})), properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="var1", doc="var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_1)), kwargs={'multi': ParamValue(True)})), properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/02fill_multi_calc_val/tiramisu/multi.py b/tests/dictionaries/02fill_multi_calc_val/tiramisu/multi.py new file mode 100644 index 000000000..90cadafa2 --- /dev/null +++ b/tests/dictionaries/02fill_multi_calc_val/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="var1", doc="var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_1)), kwargs={'multi': ParamValue(True)})), properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_3 = StrOption(name="var1", doc="var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_3)), kwargs={'multi': ParamValue(True)})), properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/base.py b/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/base.py index 57f39308e..8a514fc80 100644 --- a/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/base.py +++ b/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="var1", doc="var1", multi=True, default=['no', 'yes', 'maybe'], default_multi="no", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_2)))), properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="var1", doc="var1", multi=True, default=['no', 'yes', 'maybe'], default_multi="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_1)))), properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/multi.py b/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/multi.py new file mode 100644 index 000000000..f4cc46c83 --- /dev/null +++ b/tests/dictionaries/02fill_multi_calc_val_multi/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="var1", doc="var1", multi=True, default=['no', 'yes', 'maybe'], default_multi="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_1)))), properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_3 = StrOption(name="var1", doc="var1", multi=True, default=['no', 'yes', 'maybe'], default_multi="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_3)))), properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/10autosave_hidden/tiramisu/base.py b/tests/dictionaries/10autosave_hidden/tiramisu/base.py index 03d74a614..9ea293533 100644 --- a/tests/dictionaries/10autosave_hidden/tiramisu/base.py +++ b/tests/dictionaries/10autosave_hidden/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", "frozen", "hidden"})) -option_3 = OptionDescription(name="general", doc="général", children=[option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", "frozen", "hidden"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10autosave_hidden/tiramisu/multi.py b/tests/dictionaries/10autosave_hidden/tiramisu/multi.py new file mode 100644 index 000000000..b49ba6977 --- /dev/null +++ b/tests/dictionaries/10autosave_hidden/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", "frozen", "hidden"})) +optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", "frozen", "hidden"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7, option_8], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_5, optiondescription_6]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10check_base/tiramisu/base.py b/tests/dictionaries/10check_base/tiramisu/base.py index ad809bbb3..2c36cfec7 100644 --- a/tests/dictionaries/10check_base/tiramisu/base.py +++ b/tests/dictionaries/10check_base/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) -option_4 = IntOption(name="int", doc="No change", min_number=0, max_number=100, properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int", doc="No change", min_number=0, max_number=100, properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10check_base/tiramisu/multi.py b/tests/dictionaries/10check_base/tiramisu/multi.py new file mode 100644 index 000000000..d2c7081d6 --- /dev/null +++ b/tests/dictionaries/10check_base/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int", doc="No change", min_number=0, max_number=100, properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_6 = IntOption(name="int", doc="No change", min_number=0, max_number=100, properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10check_base_target_optional/tiramisu/base.py b/tests/dictionaries/10check_base_target_optional/tiramisu/base.py index 6a43317d7..49e7bd021 100644 --- a/tests/dictionaries/10check_base_target_optional/tiramisu/base.py +++ b/tests/dictionaries/10check_base_target_optional/tiramisu/base.py @@ -2,18 +2,22 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/dictionaries/10check_base_target_optional/tiramisu/multi.py b/tests/dictionaries/10check_base_target_optional/tiramisu/multi.py new file mode 100644 index 000000000..d79723970 --- /dev/null +++ b/tests/dictionaries/10check_base_target_optional/tiramisu/multi.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +optiondescription_3 = OptionDescription(name="1", doc="1", children=[optiondescription_4]) +option_2 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3, optiondescription_5]) diff --git a/tests/dictionaries/10check_no_param/tiramisu/base.py b/tests/dictionaries/10check_no_param/tiramisu/base.py index 1aa8eb9a3..674d369d4 100644 --- a/tests/dictionaries/10check_no_param/tiramisu/base.py +++ b/tests/dictionaries/10check_no_param/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) -option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False))), warnings_only=False)], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10check_no_param/tiramisu/multi.py b/tests/dictionaries/10check_no_param/tiramisu/multi.py new file mode 100644 index 000000000..b336c96ea --- /dev/null +++ b/tests/dictionaries/10check_no_param/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_6 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10check_option/tiramisu/base.py b/tests/dictionaries/10check_option/tiramisu/base.py index cecf0a005..8a04bac9a 100644 --- a/tests/dictionaries/10check_option/tiramisu/base.py +++ b/tests/dictionaries/10check_option/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) -option_4 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"})) -option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False)), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_4)}), warnings_only=False)], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"})) +option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False)), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_3)}), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10check_option/tiramisu/multi.py b/tests/dictionaries/10check_option/tiramisu/multi.py new file mode 100644 index 000000000..35db69c1e --- /dev/null +++ b/tests/dictionaries/10check_option/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_3 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"})) +option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False)), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_3)}), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_7 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"})) +option_8 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False)), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_7)}), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10check_optional/tiramisu/base.py b/tests/dictionaries/10check_optional/tiramisu/base.py index 7ea41c2ba..0c60303b9 100644 --- a/tests/dictionaries/10check_optional/tiramisu/base.py +++ b/tests/dictionaries/10check_optional/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) -option_5 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"})) -option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_4 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"})) +option_3 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10check_optional/tiramisu/multi.py b/tests/dictionaries/10check_optional/tiramisu/multi.py new file mode 100644 index 000000000..029b66486 --- /dev/null +++ b/tests/dictionaries/10check_optional/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_4 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"})) +option_3 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"})) +option_8 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"})) +option_7 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_8))), warnings_only=False)], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10check_valid_differ/tiramisu/base.py b/tests/dictionaries/10check_valid_differ/tiramisu/base.py index 3a03ece56..8057ec633 100644 --- a/tests/dictionaries/10check_valid_differ/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_differ/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10check_valid_differ/tiramisu/multi.py b/tests/dictionaries/10check_valid_differ/tiramisu/multi.py new file mode 100644 index 000000000..cf9eed678 --- /dev/null +++ b/tests/dictionaries/10check_valid_differ/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_6))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10check_valid_differ_add/tiramisu/base.py b/tests/dictionaries/10check_valid_differ_add/tiramisu/base.py index d373f46f0..a9f2a11f9 100644 --- a/tests/dictionaries/10check_valid_differ_add/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_differ_add/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10check_valid_differ_add/tiramisu/multi.py b/tests/dictionaries/10check_valid_differ_add/tiramisu/multi.py new file mode 100644 index 000000000..1eb2bf2df --- /dev/null +++ b/tests/dictionaries/10check_valid_differ_add/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_8))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_8))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_9))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/base.py b/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/base.py index cca2ce583..dd5b52c92 100644 --- a/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/multi.py b/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/multi.py new file mode 100644 index 000000000..27986b0e4 --- /dev/null +++ b/tests/dictionaries/10check_valid_differ_removecheck/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_8))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_9))), warnings_only=False)], properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10check_valid_in_network/tiramisu/base.py b/tests/dictionaries/10check_valid_in_network/tiramisu/base.py index 25ae1cd8a..4a4f64864 100644 --- a/tests/dictionaries/10check_valid_in_network/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_in_network/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) -option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"})) -option_6 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_4), ParamOption(option_5))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_4 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"})) +option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_3), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"basic"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10check_valid_in_network/tiramisu/multi.py b/tests/dictionaries/10check_valid_in_network/tiramisu/multi.py new file mode 100644 index 000000000..073a27530 --- /dev/null +++ b/tests/dictionaries/10check_valid_in_network/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_4 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"})) +option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_3), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_8 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_9 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"})) +option_10 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_8), ParamOption(option_9))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"basic"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/base.py b/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/base.py index e3d948416..5e7771899 100644 --- a/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"})) -option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"})) +option_4 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/multi.py b/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/multi.py new file mode 100644 index 000000000..92ecb854e --- /dev/null +++ b/tests/dictionaries/10check_valid_in_network_cidr/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"})) +option_4 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_7 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"})) +option_8 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_7))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10check_valid_ipnetmask/tiramisu/base.py b/tests/dictionaries/10check_valid_ipnetmask/tiramisu/base.py index 73de640bb..12fca3582 100644 --- a/tests/dictionaries/10check_valid_ipnetmask/tiramisu/base.py +++ b/tests/dictionaries/10check_valid_ipnetmask/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) -option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=True)], properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_4 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=True)], properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10check_valid_ipnetmask/tiramisu/multi.py b/tests/dictionaries/10check_valid_ipnetmask/tiramisu/multi.py new file mode 100644 index 000000000..165737e09 --- /dev/null +++ b/tests/dictionaries/10check_valid_ipnetmask/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_4 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(whole=False), ParamOption(option_3))), warnings_only=True)], properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_7 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"})) +option_8 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(whole=False), ParamOption(option_7))), warnings_only=True)], properties=frozenset({"basic", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"basic"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10fill_information/tiramisu/base.py b/tests/dictionaries/10fill_information/tiramisu/base.py index ee1fd38f7..b69d426a2 100644 --- a/tests/dictionaries/10fill_information/tiramisu/base.py +++ b/tests/dictionaries/10fill_information/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)))), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/10fill_information/tiramisu/multi.py b/tests/dictionaries/10fill_information/tiramisu/multi.py new file mode 100644 index 000000000..74f1a263b --- /dev/null +++ b/tests/dictionaries/10fill_information/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)))), properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/10fill_information_multi/tiramisu/base.py b/tests/dictionaries/10fill_information_multi/tiramisu/base.py index 9fb41d3d6..e978e7a42 100644 --- a/tests/dictionaries/10fill_information_multi/tiramisu/base.py +++ b/tests/dictionaries/10fill_information_multi/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=[Calculation(func.calc_val, Params((ParamInformation("test_information", []))))], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=[Calculation(func.calc_val, Params((ParamInformation("test_information", []))))], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/10fill_information_multi/tiramisu/multi.py b/tests/dictionaries/10fill_information_multi/tiramisu/multi.py new file mode 100644 index 000000000..faffd474f --- /dev/null +++ b/tests/dictionaries/10fill_information_multi/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=[Calculation(func.calc_val, Params((ParamInformation("test_information", []))))], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=[Calculation(func.calc_val, Params((ParamInformation("test_information", []))))], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/base.py b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/base.py index d11af37fc..090266524 100644 --- a/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/base.py +++ b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_6 = IntOption(name="test_variable", doc="test variable", properties=frozenset({"expert"})) -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5, option_6], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +option_5 = IntOption(name="test_variable", doc="test variable", properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4, option_5], properties=frozenset({"expert"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/multi.py b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/multi.py new file mode 100644 index 000000000..65e997fb5 --- /dev/null +++ b/tests/dictionaries/10frozenifin_unknown_valid_enum_number/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +option_5 = IntOption(name="test_variable", doc="test variable", properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4, option_5], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7], properties=frozenset({"expert"})) +option_9 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_9.impl_set_information('help', "bla bla bla") +option_10 = IntOption(name="test_variable", doc="test variable", properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="enumfam", doc="enumfam", children=[option_9, option_10], properties=frozenset({"expert"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6, optiondescription_8]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10leadership_append/tiramisu/base.py b/tests/dictionaries/10leadership_append/tiramisu/base.py index ea8c37ea4..9daedb34b 100644 --- a/tests/dictionaries/10leadership_append/tiramisu/base.py +++ b/tests/dictionaries/10leadership_append/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_9 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8, option_9], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9]) diff --git a/tests/dictionaries/10leadership_append/tiramisu/multi.py b/tests/dictionaries/10leadership_append/tiramisu/multi.py new file mode 100644 index 000000000..b810617c5 --- /dev/null +++ b/tests/dictionaries/10leadership_append/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18]) +option_10 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="general", children=[option_10], properties=frozenset({"normal"})) +option_13 = StrOption(name="leader", doc="leader", multi=True) +option_14 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_15 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_14)))), properties=frozenset({"normal"})) +option_16 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_12 = Leadership(name="leader", doc="leader", children=[option_13, option_14, option_15, option_16], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="general1", doc="general1", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9, optiondescription_11]) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_19]) diff --git a/tests/dictionaries/10leadership_append_hidden/tiramisu/base.py b/tests/dictionaries/10leadership_append_hidden/tiramisu/base.py index 06c952899..01ba522da 100644 --- a/tests/dictionaries/10leadership_append_hidden/tiramisu/base.py +++ b/tests/dictionaries/10leadership_append_hidden/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"force_default_on_freeze", "frozen"})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) -option_9 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8, option_9], properties=frozenset({"hidden", "normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"force_default_on_freeze", "frozen"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7, option_8], properties=frozenset({"hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9]) diff --git a/tests/dictionaries/10leadership_append_hidden/tiramisu/multi.py b/tests/dictionaries/10leadership_append_hidden/tiramisu/multi.py new file mode 100644 index 000000000..6e7cf6964 --- /dev/null +++ b/tests/dictionaries/10leadership_append_hidden/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"force_default_on_freeze", "frozen"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7, option_8], properties=frozenset({"hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18]) +option_10 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="general", children=[option_10], properties=frozenset({"normal"})) +option_13 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"force_default_on_freeze", "frozen"})) +option_14 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_15 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_14)))), properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_16 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_12 = Leadership(name="leader", doc="leader", children=[option_13, option_14, option_15, option_16], properties=frozenset({"hidden", "normal"})) +optiondescription_11 = OptionDescription(name="general1", doc="general1", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9, optiondescription_11]) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_19]) diff --git a/tests/dictionaries/10leadership_append_name/tiramisu/base.py b/tests/dictionaries/10leadership_append_name/tiramisu/base.py index 986503e7d..058cc4cf7 100644 --- a/tests/dictionaries/10leadership_append_name/tiramisu/base.py +++ b/tests/dictionaries/10leadership_append_name/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_9 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) -option_5 = Leadership(name="leadership", doc="leadership", children=[option_6, option_7, option_8, option_9], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leadership", doc="leadership", children=[option_5, option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9]) diff --git a/tests/dictionaries/10leadership_append_name/tiramisu/multi.py b/tests/dictionaries/10leadership_append_name/tiramisu/multi.py new file mode 100644 index 000000000..6cfe6fc31 --- /dev/null +++ b/tests/dictionaries/10leadership_append_name/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +option_8 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leadership", doc="leadership", children=[option_5, option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18]) +option_10 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="general", children=[option_10], properties=frozenset({"normal"})) +option_13 = StrOption(name="leader", doc="leader", multi=True) +option_14 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_15 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_14)))), properties=frozenset({"normal"})) +option_16 = StrOption(name="follower3", doc="follower3", multi=True, properties=frozenset({"normal"})) +optiondescription_12 = Leadership(name="leadership", doc="leadership", children=[option_13, option_14, option_15, option_16], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="general1", doc="general1", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9, optiondescription_11]) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_19]) diff --git a/tests/dictionaries/10leadership_auto/tiramisu/base.py b/tests/dictionaries/10leadership_auto/tiramisu/base.py index 5c151ae68..0608ec3c4 100644 --- a/tests/dictionaries/10leadership_auto/tiramisu/base.py +++ b/tests/dictionaries/10leadership_auto/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_8 = StrOption(name="follower3", doc="follower3", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7, option_8], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_7 = StrOption(name="follower3", doc="follower3", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10leadership_auto/tiramisu/multi.py b/tests/dictionaries/10leadership_auto/tiramisu/multi.py new file mode 100644 index 000000000..105afcf44 --- /dev/null +++ b/tests/dictionaries/10leadership_auto/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_7 = StrOption(name="follower3", doc="follower3", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_11 = StrOption(name="leader", doc="leader", multi=True) +option_12 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_13 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_12)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_14 = StrOption(name="follower3", doc="follower3", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_11)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_10 = Leadership(name="leader", doc="leader", children=[option_11, option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9, optiondescription_10], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10leadership_auto_index/tiramisu/base.py b/tests/dictionaries/10leadership_auto_index/tiramisu/base.py index a48fab4e9..f01a1e857 100644 --- a/tests/dictionaries/10leadership_auto_index/tiramisu/base.py +++ b/tests/dictionaries/10leadership_auto_index/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b', 'c'], properties=frozenset({"mandatory"})) -option_4 = IntOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((ParamIndex()))), properties=frozenset({"normal"})) -option_2 = Leadership(name="leader", doc="leader", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b', 'c'], properties=frozenset({"mandatory"})) +option_3 = IntOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((ParamIndex()))), properties=frozenset({"normal"})) +optiondescription_1 = Leadership(name="leader", doc="leader", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10leadership_auto_index/tiramisu/multi.py b/tests/dictionaries/10leadership_auto_index/tiramisu/multi.py new file mode 100644 index 000000000..3447e3fac --- /dev/null +++ b/tests/dictionaries/10leadership_auto_index/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b', 'c'], properties=frozenset({"mandatory"})) +option_3 = IntOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((ParamIndex()))), properties=frozenset({"normal"})) +optiondescription_1 = Leadership(name="leader", doc="leader", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b', 'c'], properties=frozenset({"mandatory"})) +option_6 = IntOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((ParamIndex()))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10leadership_autoleader/tiramisu/base.py b/tests/dictionaries/10leadership_autoleader/tiramisu/base.py index 059e8bbcd..01d6292fe 100644 --- a/tests/dictionaries/10leadership_autoleader/tiramisu/base.py +++ b/tests/dictionaries/10leadership_autoleader/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10leadership_autoleader/tiramisu/multi.py b/tests/dictionaries/10leadership_autoleader/tiramisu/multi.py new file mode 100644 index 000000000..11e9f48df --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_10)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10leadership_autoleader_expert/tiramisu/base.py b/tests/dictionaries/10leadership_autoleader_expert/tiramisu/base.py index 9c4a7021e..a6129db01 100644 --- a/tests/dictionaries/10leadership_autoleader_expert/tiramisu/base.py +++ b/tests/dictionaries/10leadership_autoleader_expert/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"expert"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"expert"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"expert"})) -option_4 = OptionDescription(name="leadermode", doc="leadermode", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")}))) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"expert"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"expert"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10leadership_autoleader_expert/tiramisu/multi.py b/tests/dictionaries/10leadership_autoleader_expert/tiramisu/multi.py new file mode 100644 index 000000000..41d55282a --- /dev/null +++ b/tests/dictionaries/10leadership_autoleader_expert/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")}))) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"expert"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"expert"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"expert"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"expert"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")}))) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"expert"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"expert"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_11], properties=frozenset({"expert"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10leadership_autosaveexpert/tiramisu/base.py b/tests/dictionaries/10leadership_autosaveexpert/tiramisu/base.py index 8c59d659a..cb824db00 100644 --- a/tests/dictionaries/10leadership_autosaveexpert/tiramisu/base.py +++ b/tests/dictionaries/10leadership_autosaveexpert/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"expert"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"expert"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10leadership_autosaveexpert/tiramisu/multi.py b/tests/dictionaries/10leadership_autosaveexpert/tiramisu/multi.py new file mode 100644 index 000000000..cb52db641 --- /dev/null +++ b/tests/dictionaries/10leadership_autosaveexpert/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"expert"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_11)))), properties=frozenset({"expert"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10leadership_empty/tiramisu/base.py b/tests/dictionaries/10leadership_empty/tiramisu/base.py index 193fa8a73..a6054fc43 100644 --- a/tests/dictionaries/10leadership_empty/tiramisu/base.py +++ b/tests/dictionaries/10leadership_empty/tiramisu/base.py @@ -2,21 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[]) -option_4 = BoolOption(name="activate", doc="activate", default=True) -option_5 = BoolOption(name="manage", doc="manage", default=True) -option_3 = OptionDescription(name="tata_service", doc="tata.service", children=[option_4, option_5]) -option_2 = OptionDescription(name="services", doc="services", children=[option_3], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2]) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_3 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="tata_service", doc="tata.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('type', "service") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/10leadership_empty/tiramisu/multi.py b/tests/dictionaries/10leadership_empty/tiramisu/multi.py new file mode 100644 index 000000000..708c7262a --- /dev/null +++ b/tests/dictionaries/10leadership_empty/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="tata_service", doc="tata.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/10leadership_leader_hidden/tiramisu/base.py b/tests/dictionaries/10leadership_leader_hidden/tiramisu/base.py index 9149f86d3..1cd82bdd1 100644 --- a/tests/dictionaries/10leadership_leader_hidden/tiramisu/base.py +++ b/tests/dictionaries/10leadership_leader_hidden/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen"})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"hidden", "normal"})) -option_4 = OptionDescription(name="leadermode", doc="leadermode", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"hidden", "normal"})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10leadership_leader_hidden/tiramisu/multi.py b/tests/dictionaries/10leadership_leader_hidden/tiramisu/multi.py new file mode 100644 index 000000000..2028c0484 --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"hidden", "normal"})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"expert"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen"})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"force_default_on_freeze", "frozen", "normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"hidden", "normal"})) +optiondescription_10 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/base.py b/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/base.py index aa7382740..b1034ffd4 100644 --- a/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/base.py +++ b/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_4 = OptionDescription(name="leadermode", doc="leadermode", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/multi.py b/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/multi.py new file mode 100644 index 000000000..287631315 --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden_if_in/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"expert"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_10 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/base.py b/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/base.py index 7258b19e1..1b2d88394 100644 --- a/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/base.py +++ b/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_5 = Leadership(name="other", doc="other", children=[option_6, option_7, option_8], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_4 = OptionDescription(name="leadermode", doc="leadermode", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_4 = Leadership(name="other", doc="other", children=[option_5, option_6, option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/multi.py b/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/multi.py new file mode 100644 index 000000000..e79a1de89 --- /dev/null +++ b/tests/dictionaries/10leadership_leader_hidden_if_in_name/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_4 = Leadership(name="other", doc="other", children=[option_5, option_6, option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"expert"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_11 = Leadership(name="other", doc="other", children=[option_12, option_13, option_14], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_10 = OptionDescription(name="leadermode", doc="leadermode", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10leadership_leadermandatory/tiramisu/base.py b/tests/dictionaries/10leadership_leadermandatory/tiramisu/base.py index 410d38860..42981b001 100644 --- a/tests/dictionaries/10leadership_leadermandatory/tiramisu/base.py +++ b/tests/dictionaries/10leadership_leadermandatory/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"mandatory"})) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"basic"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10leadership_leadermandatory/tiramisu/multi.py b/tests/dictionaries/10leadership_leadermandatory/tiramisu/multi.py new file mode 100644 index 000000000..1c049ad05 --- /dev/null +++ b/tests/dictionaries/10leadership_leadermandatory/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"basic"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"mandatory"})) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_11)))), properties=frozenset({"normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"basic"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10leadership_mandatory/tiramisu/base.py b/tests/dictionaries/10leadership_mandatory/tiramisu/base.py index fcee64331..326b1fc14 100644 --- a/tests/dictionaries/10leadership_mandatory/tiramisu/base.py +++ b/tests/dictionaries/10leadership_mandatory/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"mandatory", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10leadership_mandatory/tiramisu/multi.py b/tests/dictionaries/10leadership_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..41910619e --- /dev/null +++ b/tests/dictionaries/10leadership_mandatory/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5)))), properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_11)))), properties=frozenset({"normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/base.py b/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/base.py index 478d82537..f289f2f6d 100644 --- a/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/base.py +++ b/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) -option_6 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, properties=frozenset({"basic", "mandatory"})) -option_4 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_5, option_6], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_5 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/multi.py b/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/multi.py new file mode 100644 index 000000000..b3e8edc53 --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_5 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_9 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_10 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, properties=frozenset({"basic", "mandatory"})) +optiondescription_8 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7, optiondescription_8], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/00-base.xml b/tests/dictionaries/10leadership_mandatoryfollower_value/00-base.xml new file mode 100644 index 000000000..b0f28bf09 --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/00-base.xml @@ -0,0 +1,17 @@ + + + + + + + + + 192.168.0.0 + + + + + + diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/__init__.py b/tests/dictionaries/10leadership_mandatoryfollower_value/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/after.json b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/after.json new file mode 100644 index 000000000..c66326dac --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/after.json @@ -0,0 +1,14 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "oui" + }, + "rougail.general.nut_monitor_netmask.nut_monitor_netmask": { + "owner": "default", + "value": [] + }, + "rougail.general.nut_monitor_netmask.nut_monitor_host": { + "owner": [], + "value": [] + } +} diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/base.json b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/base.json new file mode 100644 index 000000000..af7d636d7 --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/base.json @@ -0,0 +1,4 @@ +{ + "rougail.general.mode_conteneur_actif": "oui", + "rougail.general.nut_monitor_netmask.nut_monitor_netmask": [] +} diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/before.json b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/before.json new file mode 100644 index 000000000..c66326dac --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/makedict/before.json @@ -0,0 +1,14 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "oui" + }, + "rougail.general.nut_monitor_netmask.nut_monitor_netmask": { + "owner": "default", + "value": [] + }, + "rougail.general.nut_monitor_netmask.nut_monitor_host": { + "owner": [], + "value": [] + } +} diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/base.py b/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/base.py new file mode 100644 index 000000000..00c593c05 --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/base.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_5 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, default_multi="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/multi.py b/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/multi.py new file mode 100644 index 000000000..ac454079b --- /dev/null +++ b/tests/dictionaries/10leadership_mandatoryfollower_value/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_5 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, default_multi="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_9 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True) +option_10 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, default_multi="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = Leadership(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7, optiondescription_8], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10leadership_multi/tiramisu/base.py b/tests/dictionaries/10leadership_multi/tiramisu/base.py index ec1db9f51..6483a71f6 100644 --- a/tests/dictionaries/10leadership_multi/tiramisu/base.py +++ b/tests/dictionaries/10leadership_multi/tiramisu/base.py @@ -2,28 +2,32 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_10 = StrOption(name="leader1", doc="leader", multi=True) -option_11 = StrOption(name="follower11", doc="follower1", multi=True, properties=frozenset({"normal"})) -option_12 = StrOption(name="follower21", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_9 = Leadership(name="leader1", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5, option_9], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +option_9 = StrOption(name="leader1", doc="leader", multi=True) +option_10 = StrOption(name="follower11", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_11 = StrOption(name="follower21", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_8 = Leadership(name="leader1", doc="leader", children=[option_9, option_10, option_11], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4, optiondescription_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12]) diff --git a/tests/dictionaries/10leadership_multi/tiramisu/multi.py b/tests/dictionaries/10leadership_multi/tiramisu/multi.py new file mode 100644 index 000000000..357c85c9c --- /dev/null +++ b/tests/dictionaries/10leadership_multi/tiramisu/multi.py @@ -0,0 +1,47 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +option_9 = StrOption(name="leader1", doc="leader", multi=True) +option_10 = StrOption(name="follower11", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_11 = StrOption(name="follower21", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_8 = Leadership(name="leader1", doc="leader", children=[option_9, option_10, option_11], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4, optiondescription_8], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24]) +option_13 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="general", doc="general", children=[option_13], properties=frozenset({"normal"})) +option_16 = StrOption(name="leader", doc="leader", multi=True) +option_17 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_18 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_17)))), properties=frozenset({"normal"})) +optiondescription_15 = Leadership(name="leader", doc="leader", children=[option_16, option_17, option_18], properties=frozenset({"normal"})) +option_20 = StrOption(name="leader1", doc="leader", multi=True) +option_21 = StrOption(name="follower11", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_22 = StrOption(name="follower21", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_19 = Leadership(name="leader1", doc="leader", children=[option_20, option_21, option_22], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="general1", doc="general1", children=[optiondescription_15, optiondescription_19], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_12, optiondescription_14]) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in/tiramisu/base.py index e06d81afb..829c42453 100644 --- a/tests/dictionaries/10load_disabled_if_in/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in/tiramisu/multi.py new file mode 100644 index 000000000..6ce354ca6 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/base.py index ce7a0e868..3e29eafa4 100644 --- a/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) -option_5 = StrOption(name="variable2", doc="variable2", default=Calculation(func.calc_val, Params((ParamOption(option_4, notraisepropertyerror=True)))), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_4 = StrOption(name="variable2", doc="variable2", default=Calculation(func.calc_val, Params((ParamOption(option_3, notraisepropertyerror=True)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/multi.py new file mode 100644 index 000000000..14c0fdf05 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_fill/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_4 = StrOption(name="variable2", doc="variable2", default=Calculation(func.calc_val, Params((ParamOption(option_3, notraisepropertyerror=True)))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_8 = StrOption(name="variable2", doc="variable2", default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=True)))), properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/base.py index 7fa97e499..65605c4f7 100644 --- a/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/base.py @@ -2,18 +2,22 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/multi.py new file mode 100644 index 000000000..04105648d --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_list_optional/tiramisu/multi.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +optiondescription_3 = OptionDescription(name="1", doc="1", children=[optiondescription_4]) +option_2 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3, optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py index 92bbcfec1..a59d03e2e 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/multi.py new file mode 100644 index 000000000..ced5399c1 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py index e59aa22fc..886d085b0 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/multi.py new file mode 100644 index 000000000..4c27884ba --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_7, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py index ea134d3f3..b6d035406 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/multi.py new file mode 100644 index 000000000..4badad189 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_7, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py index d060504dc..b20ca2641 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/multi.py new file mode 100644 index 000000000..235617402 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition2", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_7, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py index 0653090d2..f7e27b9d1 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/multi.py new file mode 100644 index 000000000..265996a6a --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_7, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py index 56db7f17e..95a13e5d9 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/multi.py new file mode 100644 index 000000000..ab9aba1b7 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition2", doc="No change", default="yes", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_7, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py index 218aebe60..d8ac157fd 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/multi.py new file mode 100644 index 000000000..22c7d4fb0 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +optiondescription_17 = OptionDescription(name="file1", doc="file1", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file1") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/10load_disabled_if_in_none/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_none/tiramisu/base.py index 3f235e422..08cd641a8 100644 --- a/tests/dictionaries/10load_disabled_if_in_none/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_none/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in_none/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_none/tiramisu/multi.py new file mode 100644 index 000000000..6981b6a2b --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_none/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue(None)}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/base.py index 97689191c..5b7fec7c3 100644 --- a/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) -option_4 = StrOption(name="my_var3", doc="my_var3", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_3 = StrOption(name="my_var3", doc="my_var3", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/multi.py new file mode 100644 index 000000000..1d79e8a75 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_3 = StrOption(name="my_var3", doc="my_var3", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_4 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_6 = StrOption(name="my_var3", doc="my_var3", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, option_5, option_6]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py index 9943280d0..27f50dfd7 100644 --- a/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_4)}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/multi.py new file mode 100644 index 000000000..12b1afb2f --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_7)}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py index 7a815def0..0fecb15ec 100644 --- a/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="aucun", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_4)}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="aucun", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/multi.py new file mode 100644 index 000000000..d0180dbda --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="aucun", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="aucun", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_7)}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py index cbe9e8d9b..9e5f6506d 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10]) -option_8.impl_set_information('source', "file1") -option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_12 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_11, option_12]) -option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_7 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_6 = OptionDescription(name="file1", doc="file1", children=[option_8, option_7]) +optiondescription_6.impl_set_information('source', "file1") +optiondescription_5 = OptionDescription(name="files", doc="files", children=[optiondescription_6]) +option_4 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_5, option_4, option_9]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_10, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/multi.py new file mode 100644 index 000000000..fa9e06af3 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_11 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_10 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_9 = OptionDescription(name="file1", doc="file1", children=[option_11, option_10]) +optiondescription_9.impl_set_information('source', "file1") +optiondescription_8 = OptionDescription(name="files", doc="files", children=[optiondescription_9]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_8, option_7, option_12]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="1", doc="1", children=[optiondescription_20, optiondescription_21]) +option_5 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +option_17 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_16 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_15 = OptionDescription(name="file1", doc="file1", children=[option_17, option_16]) +optiondescription_15.impl_set_information('source', "file1") +optiondescription_14 = OptionDescription(name="files", doc="files", children=[optiondescription_15]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_18 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_14, option_13, option_18]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="2", doc="2", children=[optiondescription_24, optiondescription_25]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_19, optiondescription_23]) diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/base.py index 05cc69656..61dd8f461 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/multi.py b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/multi.py new file mode 100644 index 000000000..f6e6322d5 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback_force/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py index a2d4cc8a4..963178ea4 100644 --- a/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabledifin_fallback/tiramisu/multi.py b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/multi.py new file mode 100644 index 000000000..7d2aae172 --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py index 2f0afa681..7ad718fad 100644 --- a/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/multi.py b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/multi.py new file mode 100644 index 000000000..38b01ba51 --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py index 2f0afa681..7ad718fad 100644 --- a/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/multi.py b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/multi.py new file mode 100644 index 000000000..38b01ba51 --- /dev/null +++ b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_emptyvalue/tiramisu/base.py b/tests/dictionaries/10load_emptyvalue/tiramisu/base.py index 25d1d4e91..e6841d826 100644 --- a/tests/dictionaries/10load_emptyvalue/tiramisu/base.py +++ b/tests/dictionaries/10load_emptyvalue/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"normal"})) -option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"normal"})) +option_3 = StrOption(name="mode_conteneur_actif2", doc="No change", properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10load_emptyvalue/tiramisu/multi.py b/tests/dictionaries/10load_emptyvalue/tiramisu/multi.py new file mode 100644 index 000000000..9b10aaa22 --- /dev/null +++ b/tests/dictionaries/10load_emptyvalue/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"normal"})) +option_3 = StrOption(name="mode_conteneur_actif2", doc="No change", properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"normal"})) +option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10load_frozenifin/tiramisu/base.py b/tests/dictionaries/10load_frozenifin/tiramisu/base.py index aa3ee7347..ae38f0d23 100644 --- a/tests/dictionaries/10load_frozenifin/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifin/tiramisu/multi.py b/tests/dictionaries/10load_frozenifin/tiramisu/multi.py new file mode 100644 index 000000000..df89eb2e9 --- /dev/null +++ b/tests/dictionaries/10load_frozenifin/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py index 28a4c233f..ab8bac3fc 100644 --- a/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("non")))), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("non")))), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifin_auto/tiramisu/multi.py b/tests/dictionaries/10load_frozenifin_auto/tiramisu/multi.py new file mode 100644 index 000000000..52c1ac144 --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_auto/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("non")))), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("non")))), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py index 3910308b1..5b71fc750 100644 --- a/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/multi.py b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/multi.py new file mode 100644 index 000000000..7300b5526 --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("authentifié")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifin_noexist/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_noexist/tiramisu/base.py index aa65f49d6..4b8aea4bf 100644 --- a/tests/dictionaries/10load_frozenifin_noexist/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_noexist/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifin_noexist/tiramisu/multi.py b/tests/dictionaries/10load_frozenifin_noexist/tiramisu/multi.py new file mode 100644 index 000000000..5354d6149 --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_noexist/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py index 45ac615e3..5ae602c1d 100644 --- a/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_4)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_4)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_4)}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifin_variable/tiramisu/multi.py b/tests/dictionaries/10load_frozenifin_variable/tiramisu/multi.py new file mode 100644 index 000000000..3e2a794aa --- /dev/null +++ b/tests/dictionaries/10load_frozenifin_variable/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_3)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="tous", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_7)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_7)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamOption(option_7)}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py b/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py index 632955406..1cd8a65fb 100644 --- a/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifnotin/tiramisu/multi.py b/tests/dictionaries/10load_frozenifnotin/tiramisu/multi.py new file mode 100644 index 000000000..f393daee4 --- /dev/null +++ b/tests/dictionaries/10load_frozenifnotin/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/base.py b/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/base.py index aa65f49d6..4b8aea4bf 100644 --- a/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/multi.py b/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/multi.py new file mode 100644 index 000000000..5354d6149 --- /dev/null +++ b/tests/dictionaries/10load_frozenifnotin_noexist/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py b/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py index 713062fa1..a761cdd8a 100644 --- a/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py +++ b/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="Général", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="Général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/multi.py b/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/multi.py new file mode 100644 index 000000000..0973bc22b --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="Général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_6 = OptionDescription(name="general", doc="Général", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py b/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py index cf6a7d3d1..f8d8ee2f6 100644 --- a/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py +++ b/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="Général", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_7 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_6 = OptionDescription(name="general2", doc="Général2", children=[option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="Général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general2", doc="Général2", children=[option_6], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10load_hidden_if_family/tiramisu/multi.py b/tests/dictionaries/10load_hidden_if_family/tiramisu/multi.py new file mode 100644 index 000000000..78e21a04d --- /dev/null +++ b/tests/dictionaries/10load_hidden_if_family/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="Général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general2", doc="Général2", children=[option_6], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_7 = OptionDescription(name="general", doc="Général", children=[option_8, option_9, option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_11 = OptionDescription(name="general2", doc="Général2", children=[option_12], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10load_leadership/tiramisu/base.py b/tests/dictionaries/10load_leadership/tiramisu/base.py index 122ff3a96..d8c9b038b 100644 --- a/tests/dictionaries/10load_leadership/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10load_leadership/tiramisu/multi.py b/tests/dictionaries/10load_leadership/tiramisu/multi.py new file mode 100644 index 000000000..d4a9d8c28 --- /dev/null +++ b/tests/dictionaries/10load_leadership/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_13)))), properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="general1", doc="general1", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10load_leadership_default_multi/tiramisu/base.py b/tests/dictionaries/10load_leadership_default_multi/tiramisu/base.py index 8bb498a0e..e6f3d829d 100644 --- a/tests/dictionaries/10load_leadership_default_multi/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_default_multi/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10load_leadership_default_multi/tiramisu/multi.py b/tests/dictionaries/10load_leadership_default_multi/tiramisu/multi.py new file mode 100644 index 000000000..b1bb823f0 --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_multi/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10load_leadership_default_submulti/tiramisu/base.py b/tests/dictionaries/10load_leadership_default_submulti/tiramisu/base.py index fec598033..ddd4f9e59 100644 --- a/tests/dictionaries/10load_leadership_default_submulti/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_default_submulti/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True, default=['leader'], properties=frozenset({"mandatory"})) -option_6 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, default=['leader'], properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10load_leadership_default_submulti/tiramisu/multi.py b/tests/dictionaries/10load_leadership_default_submulti/tiramisu/multi.py new file mode 100644 index 000000000..67074774d --- /dev/null +++ b/tests/dictionaries/10load_leadership_default_submulti/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, default=['leader'], properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True, default=['leader'], properties=frozenset({"mandatory"})) +option_11 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/base.py b/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/base.py index 5a4c1488c..20cbf445a 100644 --- a/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True, default=['value'], properties=frozenset({"mandatory"})) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, default=['value'], properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/multi.py b/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/multi.py new file mode 100644 index 000000000..9f75342f2 --- /dev/null +++ b/tests/dictionaries/10load_leadership_defaultmulti_leader/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True, default=['value'], properties=frozenset({"mandatory"})) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="leader", multi=True, default=['non'], default_multi="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True, default=['value'], properties=frozenset({"mandatory"})) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10load_leadership_description/tiramisu/base.py b/tests/dictionaries/10load_leadership_description/tiramisu/base.py index 8f2308c2d..a21737c93 100644 --- a/tests/dictionaries/10load_leadership_description/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_description/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="other description", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="other description", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10load_leadership_description/tiramisu/multi.py b/tests/dictionaries/10load_leadership_description/tiramisu/multi.py new file mode 100644 index 000000000..40d7334f7 --- /dev/null +++ b/tests/dictionaries/10load_leadership_description/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="other description", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_13)))), properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="other description", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="general1", doc="general1", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10load_leadership_name/tiramisu/base.py b/tests/dictionaries/10load_leadership_name/tiramisu/base.py index 1b3112a60..88ee2afcd 100644 --- a/tests/dictionaries/10load_leadership_name/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_name/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"})) -option_5 = Leadership(name="other_name", doc="other_name", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="other_name", doc="other_name", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10load_leadership_name/tiramisu/multi.py b/tests/dictionaries/10load_leadership_name/tiramisu/multi.py new file mode 100644 index 000000000..b62909c42 --- /dev/null +++ b/tests/dictionaries/10load_leadership_name/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="other_name", doc="other_name", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_13)))), properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="other_name", doc="other_name", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="general1", doc="general1", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10load_leadership_submulti/tiramisu/base.py b/tests/dictionaries/10load_leadership_submulti/tiramisu/base.py index 6e439da1d..3e48881cd 100644 --- a/tests/dictionaries/10load_leadership_submulti/tiramisu/base.py +++ b/tests/dictionaries/10load_leadership_submulti/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) -option_8 = StrOption(name="follower2", doc="follower2", multi=submulti, default=[Calculation(func.calc_val, Params((ParamOption(option_7))))], properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=submulti, default=[Calculation(func.calc_val, Params((ParamOption(option_6))))], properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/10load_leadership_submulti/tiramisu/multi.py b/tests/dictionaries/10load_leadership_submulti/tiramisu/multi.py new file mode 100644 index 000000000..0f9c80b04 --- /dev/null +++ b/tests/dictionaries/10load_leadership_submulti/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_7 = StrOption(name="follower2", doc="follower2", multi=submulti, default=[Calculation(func.calc_val, Params((ParamOption(option_6))))], properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general1", doc="general1", children=[optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9], properties=frozenset({"normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"})) +option_14 = StrOption(name="follower2", doc="follower2", multi=submulti, default=[Calculation(func.calc_val, Params((ParamOption(option_13))))], properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="general1", doc="general1", children=[optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8, optiondescription_10]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py b/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py index a1494166b..578dd2cb5 100644 --- a/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py +++ b/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_mandatoryifin/tiramisu/multi.py b/tests/dictionaries/10load_mandatoryifin/tiramisu/multi.py new file mode 100644 index 000000000..9f3c15f09 --- /dev/null +++ b/tests/dictionaries/10load_mandatoryifin/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/base.py b/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/base.py index aa65f49d6..4b8aea4bf 100644 --- a/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/base.py +++ b/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/multi.py b/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/multi.py new file mode 100644 index 000000000..5354d6149 --- /dev/null +++ b/tests/dictionaries/10load_mandatoryifnotin_noexist/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('tous', 'authentifié', 'aucun'), default="tous", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10load_multivalue/tiramisu/base.py b/tests/dictionaries/10load_multivalue/tiramisu/base.py index b272ff9e4..c479af449 100644 --- a/tests/dictionaries/10load_multivalue/tiramisu/base.py +++ b/tests/dictionaries/10load_multivalue/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=['non', 'oui'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=['non', 'oui'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/10load_multivalue/tiramisu/multi.py b/tests/dictionaries/10load_multivalue/tiramisu/multi.py new file mode 100644 index 000000000..9aa8a5db5 --- /dev/null +++ b/tests/dictionaries/10load_multivalue/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=['non', 'oui'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=['non', 'oui'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/10valid_enum_accent/tiramisu/base.py b/tests/dictionaries/10valid_enum_accent/tiramisu/base.py index da61ddbc0..400f7bfd9 100644 --- a/tests/dictionaries/10valid_enum_accent/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_accent/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c', 'é'), default="c", properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c', 'é'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_accent/tiramisu/multi.py b/tests/dictionaries/10valid_enum_accent/tiramisu/multi.py new file mode 100644 index 000000000..30379540b --- /dev/null +++ b/tests/dictionaries/10valid_enum_accent/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c', 'é'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c', 'é'), default="c", properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_append/tiramisu/base.py b/tests/dictionaries/10valid_enum_append/tiramisu/base.py index edf82ebac..9dcb71092 100644 --- a/tests/dictionaries/10valid_enum_append/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_append/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_append/tiramisu/multi.py b/tests/dictionaries/10valid_enum_append/tiramisu/multi.py new file mode 100644 index 000000000..17f31fe15 --- /dev/null +++ b/tests/dictionaries/10valid_enum_append/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_base/tiramisu/base.py b/tests/dictionaries/10valid_enum_base/tiramisu/base.py index edf82ebac..9dcb71092 100644 --- a/tests/dictionaries/10valid_enum_base/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_base/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_base/tiramisu/multi.py b/tests/dictionaries/10valid_enum_base/tiramisu/multi.py new file mode 100644 index 000000000..17f31fe15 --- /dev/null +++ b/tests/dictionaries/10valid_enum_base/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/base.py b/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/base.py index 28f229b65..b63d2db06 100644 --- a/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="enumvar", values=('a', 'b', 'c', None), default="c", properties=frozenset({"expert"})) -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=('a', 'b', 'c', None), default="c", properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/multi.py b/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..5e37ce038 --- /dev/null +++ b/tests/dictionaries/10valid_enum_base_no_mandatory/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=('a', 'b', 'c', None), default="c", properties=frozenset({"expert"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="enumvar", values=('a', 'b', 'c', None), default="c", properties=frozenset({"expert"})) +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_base_redefine/tiramisu/base.py b/tests/dictionaries/10valid_enum_base_redefine/tiramisu/base.py index a4aaa0a8c..a9592f6c7 100644 --- a/tests/dictionaries/10valid_enum_base_redefine/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_base_redefine/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar2", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) -option_6 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) -option_6.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5, option_6], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar2", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_5.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4, option_5], properties=frozenset({"expert"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/10valid_enum_base_redefine/tiramisu/multi.py b/tests/dictionaries/10valid_enum_base_redefine/tiramisu/multi.py new file mode 100644 index 000000000..6e7686bb4 --- /dev/null +++ b/tests/dictionaries/10valid_enum_base_redefine/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar2", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_5.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4, option_5], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7], properties=frozenset({"expert"})) +option_9 = ChoiceOption(name="enumvar2", doc="multi", values=('a', 'b', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_10 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'c'), default="c", properties=frozenset({"expert", "mandatory"})) +option_10.impl_set_information('help', "bla bla bla") +optiondescription_8 = OptionDescription(name="enumfam", doc="enumfam", children=[option_9, option_10], properties=frozenset({"expert"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6, optiondescription_8]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/10valid_enum_leader/tiramisu/base.py b/tests/dictionaries/10valid_enum_leader/tiramisu/base.py index 2a2415d43..0010054a0 100644 --- a/tests/dictionaries/10valid_enum_leader/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_leader/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = ChoiceOption(name="follower1", doc="follower1", values=('a', 'b', 'c'), multi=True, default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = ChoiceOption(name="follower1", doc="follower1", values=('a', 'b', 'c'), multi=True, default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/10valid_enum_leader/tiramisu/multi.py b/tests/dictionaries/10valid_enum_leader/tiramisu/multi.py new file mode 100644 index 000000000..fa2335eb9 --- /dev/null +++ b/tests/dictionaries/10valid_enum_leader/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = ChoiceOption(name="follower1", doc="follower1", values=('a', 'b', 'c'), multi=True, default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = ChoiceOption(name="follower1", doc="follower1", values=('a', 'b', 'c'), multi=True, default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/10valid_enum_mandatory/tiramisu/base.py b/tests/dictionaries/10valid_enum_mandatory/tiramisu/base.py index 271a3ecaa..ccc420d8e 100644 --- a/tests/dictionaries/10valid_enum_mandatory/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_mandatory/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="a", properties=frozenset({"expert", "mandatory"})) -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="a", properties=frozenset({"expert", "mandatory"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_mandatory/tiramisu/multi.py b/tests/dictionaries/10valid_enum_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..266ab55be --- /dev/null +++ b/tests/dictionaries/10valid_enum_mandatory/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="a", properties=frozenset({"expert", "mandatory"})) +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', 'c'), default="a", properties=frozenset({"expert", "mandatory"})) +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_multi/tiramisu/base.py b/tests/dictionaries/10valid_enum_multi/tiramisu/base.py index 0ce281ac4..e7ee2cf23 100644 --- a/tests/dictionaries/10valid_enum_multi/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_multi/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = ChoiceOption(name="multi", doc="multi", values=('a', 'b', 'c'), multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = ChoiceOption(name="multi", doc="multi", values=('a', 'b', 'c'), multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/10valid_enum_multi/tiramisu/multi.py b/tests/dictionaries/10valid_enum_multi/tiramisu/multi.py new file mode 100644 index 000000000..915452d4a --- /dev/null +++ b/tests/dictionaries/10valid_enum_multi/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = ChoiceOption(name="multi", doc="multi", values=('a', 'b', 'c'), multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="multi", doc="multi", values=('a', 'b', 'c'), multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/10valid_enum_none/tiramisu/base.py b/tests/dictionaries/10valid_enum_none/tiramisu/base.py index 2bd349e37..9732ca739 100644 --- a/tests/dictionaries/10valid_enum_none/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_none/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', None), default="b", properties=frozenset({"expert"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', None), default="b", properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_none/tiramisu/multi.py b/tests/dictionaries/10valid_enum_none/tiramisu/multi.py new file mode 100644 index 000000000..02adeeb3f --- /dev/null +++ b/tests/dictionaries/10valid_enum_none/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', None), default="b", properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', None), default="b", properties=frozenset({"expert"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_number/tiramisu/base.py b/tests/dictionaries/10valid_enum_number/tiramisu/base.py index 9aeb43741..01c450296 100644 --- a/tests/dictionaries/10valid_enum_number/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_number/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_number/tiramisu/multi.py b/tests/dictionaries/10valid_enum_number/tiramisu/multi.py new file mode 100644 index 000000000..19e1ae189 --- /dev/null +++ b/tests/dictionaries/10valid_enum_number/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_numberdefault/tiramisu/base.py b/tests/dictionaries/10valid_enum_numberdefault/tiramisu/base.py index 0a1fd62de..d1c1f8cb6 100644 --- a/tests/dictionaries/10valid_enum_numberdefault/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_numberdefault/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=3, properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=3, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_numberdefault/tiramisu/multi.py b/tests/dictionaries/10valid_enum_numberdefault/tiramisu/multi.py new file mode 100644 index 000000000..4bdf38f2f --- /dev/null +++ b/tests/dictionaries/10valid_enum_numberdefault/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=3, properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=3, properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_param_empty/tiramisu/base.py b/tests/dictionaries/10valid_enum_param_empty/tiramisu/base.py index 060ce9e97..211fbb9f5 100644 --- a/tests/dictionaries/10valid_enum_param_empty/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_param_empty/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_param_empty/tiramisu/multi.py b/tests/dictionaries/10valid_enum_param_empty/tiramisu/multi.py new file mode 100644 index 000000000..44380ed6a --- /dev/null +++ b/tests/dictionaries/10valid_enum_param_empty/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_param_empty2/tiramisu/base.py b/tests/dictionaries/10valid_enum_param_empty2/tiramisu/base.py index 060ce9e97..211fbb9f5 100644 --- a/tests/dictionaries/10valid_enum_param_empty2/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_param_empty2/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_param_empty2/tiramisu/multi.py b/tests/dictionaries/10valid_enum_param_empty2/tiramisu/multi.py new file mode 100644 index 000000000..44380ed6a --- /dev/null +++ b/tests/dictionaries/10valid_enum_param_empty2/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=(None,), properties=frozenset({"expert"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_quote/tiramisu/base.py b/tests/dictionaries/10valid_enum_quote/tiramisu/base.py index 34d7285c0..4795bf2b1 100644 --- a/tests/dictionaries/10valid_enum_quote/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_quote/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"})) -option_5 = ChoiceOption(name="enumvar", doc="multi", values=("quote'", 'quote"', 'quote"\''), default="quote'", properties=frozenset({"expert", "mandatory"})) -option_5.impl_set_information('help', "bla bla bla") -option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=("quote'", 'quote"', 'quote"\''), default="quote'", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/10valid_enum_quote/tiramisu/multi.py b/tests/dictionaries/10valid_enum_quote/tiramisu/multi.py new file mode 100644 index 000000000..4e49fa6d2 --- /dev/null +++ b/tests/dictionaries/10valid_enum_quote/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"expert"})) +option_4 = ChoiceOption(name="enumvar", doc="multi", values=("quote'", 'quote"', 'quote"\''), default="quote'", properties=frozenset({"expert", "mandatory"})) +option_4.impl_set_information('help', "bla bla bla") +optiondescription_3 = OptionDescription(name="enumfam", doc="enumfam", children=[option_4], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"expert"})) +option_8 = ChoiceOption(name="enumvar", doc="multi", values=("quote'", 'quote"', 'quote"\''), default="quote'", properties=frozenset({"expert", "mandatory"})) +option_8.impl_set_information('help', "bla bla bla") +optiondescription_7 = OptionDescription(name="enumfam", doc="enumfam", children=[option_8], properties=frozenset({"expert"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/10valid_enum_value/tiramisu/base.py b/tests/dictionaries/10valid_enum_value/tiramisu/base.py index 588af48d0..f4b9a1631 100644 --- a/tests/dictionaries/10valid_enum_value/tiramisu/base.py +++ b/tests/dictionaries/10valid_enum_value/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=('a', 'b', 'c'), default="b", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=('a', 'b', 'c'), default="b", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/10valid_enum_value/tiramisu/multi.py b/tests/dictionaries/10valid_enum_value/tiramisu/multi.py new file mode 100644 index 000000000..a21773d5e --- /dev/null +++ b/tests/dictionaries/10valid_enum_value/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=('a', 'b', 'c'), default="b", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=('a', 'b', 'c'), default="b", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py index fadb7853a..bb09c28ca 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/etc/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/multi.py new file mode 100644 index 000000000..83c39f367 --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/etc/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py index fda8a2cdc..a522edcec 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) -option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9]) -option_7.impl_set_information('source', "file1") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_5 = OptionDescription(name="file1", doc="file1", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file1") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/multi.py new file mode 100644 index 000000000..5331eba20 --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_4 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_15 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_4, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_13 = OptionDescription(name="file1", doc="file1", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file1") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py index aa0409430..a79880d51 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="condition", doc="condition", default=False, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) -option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9]) -option_7.impl_set_information('source', "file1") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = BoolOption(name="condition", doc="condition", default=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_5 = OptionDescription(name="file1", doc="file1", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file1") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/multi.py new file mode 100644 index 000000000..029d17b4a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = BoolOption(name="condition", doc="condition", default=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_4 = BoolOption(name="condition", doc="condition", default=False, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_15 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_4, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +optiondescription_13 = OptionDescription(name="file1", doc="file1", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file1") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py index ed3eee5a4..021480560 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/etc/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/multi.py new file mode 100644 index 000000000..366b00604 --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/etc/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py index c6dbd0a71..ad273011a 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py @@ -2,34 +2,39 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) -option_9.impl_set_information('source', "file1") -option_13 = FilenameOption(name="name", doc="name", default="/tmp/file2") -option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_12 = OptionDescription(name="file2", doc="file2", children=[option_13, option_14]) -option_12.impl_set_information('source', "file2") -option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_12]) -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_16 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_15, option_16]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_7 = OptionDescription(name="file1", doc="file1", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file1") +option_12 = FilenameOption(name="name", doc="name", default="/tmp/file2") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "file2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_14, optiondescription_15]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/multi.py new file mode 100644 index 000000000..d150e334a --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/multi.py @@ -0,0 +1,61 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_11 = OptionDescription(name="file1", doc="file1", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file1") +option_16 = FilenameOption(name="name", doc="name", default="/tmp/file2") +option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_14 = OptionDescription(name="file2", doc="file2", children=[option_16, option_15]) +optiondescription_14.impl_set_information('source', "file2") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11, optiondescription_14]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_17]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="1", doc="1", children=[optiondescription_28, optiondescription_29]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_32 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_22 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_21 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_20 = OptionDescription(name="file1", doc="file1", children=[option_22, option_21]) +optiondescription_20.impl_set_information('source', "file1") +option_25 = FilenameOption(name="name", doc="name", default="/tmp/file2") +option_24 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_23 = OptionDescription(name="file2", doc="file2", children=[option_25, option_24]) +optiondescription_23.impl_set_information('source', "file2") +optiondescription_19 = OptionDescription(name="files", doc="files", children=[optiondescription_20, optiondescription_23]) +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_26 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_34 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_19, option_18, option_26]) +optiondescription_34.impl_set_information('type', "service") +optiondescription_33 = OptionDescription(name="services", doc="services", children=[optiondescription_34], properties=frozenset({"hidden"})) +optiondescription_31 = OptionDescription(name="2", doc="2", children=[optiondescription_32, optiondescription_33]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_27, optiondescription_31]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/base.py index fadb7853a..bb09c28ca 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_5 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/etc/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/multi.py b/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/multi.py new file mode 100644 index 000000000..83c39f367 --- /dev/null +++ b/tests/dictionaries/11disabled_if_in_filelist_same_name/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_4 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/etc/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_8 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py index 34bb2be1b..a13058bb3 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/multi.py b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/multi.py new file mode 100644 index 000000000..0c9032280 --- /dev/null +++ b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py index 34bb2be1b..a13058bb3 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/multi.py b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/multi.py new file mode 100644 index 000000000..0c9032280 --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py index 58a403eb1..b7fed90fa 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/multi.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/multi.py new file mode 100644 index 000000000..ef96ca91f --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_8, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py index 3b8c601a3..77b3ae50b 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="condition", doc="No change", values=('non', 'statique'), default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) -option_9.impl_set_information('source', "file") -option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_12, option_13]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = ChoiceOption(name="condition", doc="No change", values=('non', 'statique'), default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_13 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_13.impl_set_information('type', "service") +optiondescription_12 = OptionDescription(name="services", doc="services", children=[optiondescription_13], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/multi.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/multi.py new file mode 100644 index 000000000..1e4c6c5d0 --- /dev/null +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="condition", doc="No change", values=('non', 'statique'), default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_12 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "file") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23]) +option_6 = ChoiceOption(name="condition", doc="No change", values=('non', 'statique'), default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_19 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_18 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_6, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) +optiondescription_17 = OptionDescription(name="file", doc="file", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "file") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_28.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py index 35b37f269..bc9243cc1 100644 --- a/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_10 = BoolOption(name="activate", doc="activate", default=False) -option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10]) -option_8.impl_set_information('source', "file1") -option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_12 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_11, option_12]) -option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_7 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_6 = OptionDescription(name="file1", doc="file1", children=[option_8, option_7]) +optiondescription_6.impl_set_information('source', "file1") +optiondescription_5 = OptionDescription(name="files", doc="files", children=[optiondescription_6]) +option_4 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_5, option_4, option_9]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_10, optiondescription_11]) diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/multi.py b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/multi.py new file mode 100644 index 000000000..4e20bb0f8 --- /dev/null +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_11 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_10 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_9 = OptionDescription(name="file1", doc="file1", children=[option_11, option_10]) +optiondescription_9.impl_set_information('source', "file1") +optiondescription_8 = OptionDescription(name="files", doc="files", children=[optiondescription_9]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_8, option_7, option_12]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="1", doc="1", children=[optiondescription_20, optiondescription_21]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +option_17 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_16 = BoolOption(name="activate", doc="activate", default=False) +optiondescription_15 = OptionDescription(name="file1", doc="file1", children=[option_17, option_16]) +optiondescription_15.impl_set_information('source', "file1") +optiondescription_14 = OptionDescription(name="files", doc="files", children=[optiondescription_15]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_18 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_14, option_13, option_18]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="2", doc="2", children=[optiondescription_24, optiondescription_25]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_19, optiondescription_23]) diff --git a/tests/dictionaries/11valid_enum_function/tiramisu/base.py b/tests/dictionaries/11valid_enum_function/tiramisu/base.py index 3845543f2..1094dc9dc 100644 --- a/tests/dictionaries/11valid_enum_function/tiramisu/base.py +++ b/tests/dictionaries/11valid_enum_function/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="var", doc="New variable", values=Calculation(func.trange, Params((ParamValue(0), ParamValue(10)))), default=9, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="var", doc="New variable", values=Calculation(func.trange, Params((ParamValue(0), ParamValue(10)))), default=9, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/11valid_enum_function/tiramisu/multi.py b/tests/dictionaries/11valid_enum_function/tiramisu/multi.py new file mode 100644 index 000000000..76ebbf6df --- /dev/null +++ b/tests/dictionaries/11valid_enum_function/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="var", doc="New variable", values=Calculation(func.trange, Params((ParamValue(0), ParamValue(10)))), default=9, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = ChoiceOption(name="var", doc="New variable", values=Calculation(func.trange, Params((ParamValue(0), ParamValue(10)))), default=9, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/11valid_enum_variable/tiramisu/base.py b/tests/dictionaries/11valid_enum_variable/tiramisu/base.py index b29321463..1f3c8f4fd 100644 --- a/tests/dictionaries/11valid_enum_variable/tiramisu/base.py +++ b/tests/dictionaries/11valid_enum_variable/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="var", doc="New variable", multi=True, default=['a', 'b', 'c'], default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_3 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=Calculation(func.calc_value, Params((ParamOption(option_4)))), default="a", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="var", doc="New variable", multi=True, default=['a', 'b', 'c'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=Calculation(func.calc_value, Params((ParamOption(option_3)))), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/11valid_enum_variable/tiramisu/multi.py b/tests/dictionaries/11valid_enum_variable/tiramisu/multi.py new file mode 100644 index 000000000..2e4e11d35 --- /dev/null +++ b/tests/dictionaries/11valid_enum_variable/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="var", doc="New variable", multi=True, default=['a', 'b', 'c'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=Calculation(func.calc_value, Params((ParamOption(option_3)))), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="var", doc="New variable", multi=True, default=['a', 'b', 'c'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +option_5 = ChoiceOption(name="mode_conteneur_actif", doc="No change", values=Calculation(func.calc_value, Params((ParamOption(option_6)))), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/20family_append/tiramisu/base.py b/tests/dictionaries/20family_append/tiramisu/base.py index 0372e5b60..cbf1d01a4 100644 --- a/tests/dictionaries/20family_append/tiramisu/base.py +++ b/tests/dictionaries/20family_append/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/20family_append/tiramisu/multi.py b/tests/dictionaries/20family_append/tiramisu/multi.py new file mode 100644 index 000000000..1e81aa444 --- /dev/null +++ b/tests/dictionaries/20family_append/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/20family_dynamic/tiramisu/base.py b/tests/dictionaries/20family_dynamic/tiramisu/base.py index 22f545b8d..d59d6c98a 100644 --- a/tests/dictionaries/20family_dynamic/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/20family_dynamic/tiramisu/multi.py b/tests/dictionaries/20family_dynamic/tiramisu/multi.py new file mode 100644 index 000000000..04ce2ac8e --- /dev/null +++ b/tests/dictionaries/20family_dynamic/tiramisu/multi.py @@ -0,0 +1,34 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal"})) +option_8 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_7 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/20family_dynamic_calc/tiramisu/base.py b/tests/dictionaries/20family_dynamic_calc/tiramisu/base.py index 8390d33f3..7260870ad 100644 --- a/tests/dictionaries/20family_dynamic_calc/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_calc/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_7 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_5, 'val1', option_4)))), properties=frozenset({"normal"})) -option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_4, 'val1', optiondescription_3)))), properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/20family_dynamic_calc/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_calc/tiramisu/multi.py new file mode 100644 index 000000000..96aa3a125 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc/tiramisu/multi.py @@ -0,0 +1,38 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_4, 'val1', optiondescription_3)))), properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"normal"})) +option_10 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_8, notraisepropertyerror=True)))), children=[option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_10, 'val1', optiondescription_9)))), properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="new", doc="new", children=[option_12], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_9, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py index b14396614..2fab5fa58 100644 --- a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_7 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py new file mode 100644 index 000000000..1f3727281 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc2/tiramisu/multi.py @@ -0,0 +1,38 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"normal"})) +option_12 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +option_10 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_12, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_12, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_9 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_8, notraisepropertyerror=True)))), children=[option_10], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_12, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_11 = OptionDescription(name="new", doc="new", children=[option_12], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_9, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/base.py b/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/base.py index b17350086..fec150e47 100644 --- a/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", default=Calculation(func.calc_val, Params((ParamSuffix()))), properties=frozenset({"normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_7 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) -option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default=Calculation(func.calc_val, Params((ParamSuffix()))), properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/multi.py new file mode 100644 index 000000000..5960f1cb3 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_calc_suffix/tiramisu/multi.py @@ -0,0 +1,38 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default=Calculation(func.calc_val, Params((ParamSuffix()))), properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"normal"})) +option_10 = StrOption(name="vardyn", doc="No change", default=Calculation(func.calc_val, Params((ParamSuffix()))), properties=frozenset({"normal"})) +optiondescription_9 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_8, notraisepropertyerror=True)))), children=[option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="new", doc="new", children=[option_12], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_9, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/20family_dynamic_description/tiramisu/base.py b/tests/dictionaries/20family_dynamic_description/tiramisu/base.py index 3cb3db94e..042958af6 100644 --- a/tests/dictionaries/20family_dynamic_description/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_description/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py new file mode 100644 index 000000000..af4bb568b --- /dev/null +++ b/tests/dictionaries/20family_dynamic_description/tiramisu/multi.py @@ -0,0 +1,34 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal"})) +option_8 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_7 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py b/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py index 07be8748d..94b464f36 100644 --- a/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_leadership/tiramisu/base.py @@ -2,26 +2,30 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) -option_7 = StrOption(name="leader", doc="leader", multi=True) -option_8 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) -option_9 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_6 = Leadership(name="leadership", doc="leadership", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +option_6 = StrOption(name="leader", doc="leader", multi=True) +option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_5 = Leadership(name="leadership", doc="leadership", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4, optiondescription_5], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9]) diff --git a/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py new file mode 100644 index 000000000..61188a077 --- /dev/null +++ b/tests/dictionaries/20family_dynamic_leadership/tiramisu/multi.py @@ -0,0 +1,42 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +option_6 = StrOption(name="leader", doc="leader", multi=True) +option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_5 = Leadership(name="leadership", doc="leadership", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4, optiondescription_5], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18]) +option_10 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="general", children=[option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +option_14 = StrOption(name="leader", doc="leader", multi=True) +option_15 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_16 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_13 = Leadership(name="leadership", doc="leadership", children=[option_14, option_15, option_16], properties=frozenset({"normal"})) +optiondescription_11 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_10, notraisepropertyerror=True)))), children=[option_12, optiondescription_13], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9, optiondescription_11]) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_19]) diff --git a/tests/dictionaries/20family_dynamic_number/tiramisu/base.py b/tests/dictionaries/20family_dynamic_number/tiramisu/base.py index 3a5ce0b46..5259c6713 100644 --- a/tests/dictionaries/20family_dynamic_number/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_number/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = IntOption(name="varname", doc="No change", multi=True, default=[1, 2], default_multi=1, properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_7 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_5, '1', option_4)))), properties=frozenset({"normal"})) -option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = IntOption(name="varname", doc="No change", multi=True, default=[1, 2], default_multi=1, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_4, '1', optiondescription_3)))), properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/20family_dynamic_number/tiramisu/multi.py b/tests/dictionaries/20family_dynamic_number/tiramisu/multi.py new file mode 100644 index 000000000..5caf7818d --- /dev/null +++ b/tests/dictionaries/20family_dynamic_number/tiramisu/multi.py @@ -0,0 +1,38 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = IntOption(name="varname", doc="No change", multi=True, default=[1, 2], default_multi=1, properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_4, '1', optiondescription_3)))), properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="new", doc="new", children=[option_6], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = IntOption(name="varname", doc="No change", multi=True, default=[1, 2], default_multi=1, properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"normal"})) +option_10 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_8, notraisepropertyerror=True)))), children=[option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_10, '1', optiondescription_9)))), properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="new", doc="new", children=[option_12], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_9, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/20family_empty/tiramisu/base.py b/tests/dictionaries/20family_empty/tiramisu/base.py index fd66f662f..3e8960893 100644 --- a/tests/dictionaries/20family_empty/tiramisu/base.py +++ b/tests/dictionaries/20family_empty/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/20family_empty/tiramisu/multi.py b/tests/dictionaries/20family_empty/tiramisu/multi.py new file mode 100644 index 000000000..acd3ca257 --- /dev/null +++ b/tests/dictionaries/20family_empty/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/20family_hidden/tiramisu/base.py b/tests/dictionaries/20family_hidden/tiramisu/base.py index a23091c72..96611cbf9 100644 --- a/tests/dictionaries/20family_hidden/tiramisu/base.py +++ b/tests/dictionaries/20family_hidden/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"hidden", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"hidden", "normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/20family_hidden/tiramisu/multi.py b/tests/dictionaries/20family_hidden/tiramisu/multi.py new file mode 100644 index 000000000..9b4ec4700 --- /dev/null +++ b/tests/dictionaries/20family_hidden/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"hidden", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"hidden", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/20family_mode/tiramisu/base.py b/tests/dictionaries/20family_mode/tiramisu/base.py index fd66f662f..01d23890f 100644 --- a/tests/dictionaries/20family_mode/tiramisu/base.py +++ b/tests/dictionaries/20family_mode/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/20family_mode/tiramisu/multi.py b/tests/dictionaries/20family_mode/tiramisu/multi.py new file mode 100644 index 000000000..416428787 --- /dev/null +++ b/tests/dictionaries/20family_mode/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/20family_modeleadership/tiramisu/base.py b/tests/dictionaries/20family_modeleadership/tiramisu/base.py index 59e9f79db..8039039a9 100644 --- a/tests/dictionaries/20family_modeleadership/tiramisu/base.py +++ b/tests/dictionaries/20family_modeleadership/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="leader", doc="leader", multi=True) -option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) -option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"basic"})) -option_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"basic"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"basic"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/20family_modeleadership/tiramisu/multi.py b/tests/dictionaries/20family_modeleadership/tiramisu/multi.py new file mode 100644 index 000000000..59da3c056 --- /dev/null +++ b/tests/dictionaries/20family_modeleadership/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="leader", doc="leader", multi=True) +option_5 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"basic"})) +optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"basic"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="leader", doc="leader", multi=True) +option_11 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal"})) +option_12 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"basic"})) +optiondescription_9 = Leadership(name="leader", doc="leader", children=[option_10, option_11, option_12], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, optiondescription_9], properties=frozenset({"basic"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/20notemplating/tiramisu/base.py b/tests/dictionaries/20notemplating/tiramisu/base.py index 19b92de3f..4ca072e9a 100644 --- a/tests/dictionaries/20notemplating/tiramisu/base.py +++ b/tests/dictionaries/20notemplating/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('engine', "none") -option_7.impl_set_information('source', "file") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('engine', "none") +optiondescription_5.impl_set_information('source', "file") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/20notemplating/tiramisu/multi.py b/tests/dictionaries/20notemplating/tiramisu/multi.py new file mode 100644 index 000000000..260e0282b --- /dev/null +++ b/tests/dictionaries/20notemplating/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('engine', "none") +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_15 = FilenameOption(name="name", doc="name", default="/etc/file") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="file", doc="file", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "none") +optiondescription_13.impl_set_information('source', "file") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/20override/tiramisu/base.py b/tests/dictionaries/20override/tiramisu/base.py index 45239f177..38dcdc112 100644 --- a/tests/dictionaries/20override/tiramisu/base.py +++ b/tests/dictionaries/20override/tiramisu/base.py @@ -2,37 +2,43 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_13 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6]) +optiondescription_5.impl_set_information('name', "test.service") +optiondescription_5.impl_set_information('source', "test.service") +optiondescription_4 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_15 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_7]) +optiondescription_15.impl_set_information('type', "service") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="test2_service", doc="test2.service", children=[option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('name', "test2.service") +optiondescription_10.impl_set_information('source', "test2.service") +optiondescription_9 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_10]) option_8 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) -option_7.impl_set_information('name', "test.service") -option_7.impl_set_information('source', "test.service") -option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_9, option_10]) -option_14 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="test2_service", doc="test2.service", children=[option_14]) -option_13.impl_set_information('engine', "jinja2") -option_13.impl_set_information('name', "test2.service") -option_13.impl_set_information('source', "test2.service") -option_12 = OptionDescription(name="overrides", doc="overrides", children=[option_13]) -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_16 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test2_service", doc="test2.service", children=[option_12, option_15, option_16]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5, option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_12 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test2_service", doc="test2.service", children=[optiondescription_9, option_8, option_12]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_14 = OptionDescription(name="services", doc="services", children=[optiondescription_15, optiondescription_16], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_14]) diff --git a/tests/dictionaries/20override/tiramisu/multi.py b/tests/dictionaries/20override/tiramisu/multi.py new file mode 100644 index 000000000..44afe45cc --- /dev/null +++ b/tests/dictionaries/20override/tiramisu/multi.py @@ -0,0 +1,69 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) +optiondescription_7.impl_set_information('name', "test.service") +optiondescription_7.impl_set_information('source', "test.service") +optiondescription_6 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_28 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_9]) +optiondescription_28.impl_set_information('type', "service") +option_13 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_12 = OptionDescription(name="test2_service", doc="test2.service", children=[option_13]) +optiondescription_12.impl_set_information('engine', "jinja2") +optiondescription_12.impl_set_information('name', "test2.service") +optiondescription_12.impl_set_information('source', "test2.service") +optiondescription_11 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_12]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_29 = OptionDescription(name="test2_service", doc="test2.service", children=[optiondescription_11, option_10, option_14]) +optiondescription_29.impl_set_information('type', "service") +optiondescription_27 = OptionDescription(name="services", doc="services", children=[optiondescription_28, optiondescription_29], properties=frozenset({"hidden"})) +optiondescription_25 = OptionDescription(name="1", doc="1", children=[optiondescription_26, optiondescription_27]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_31 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[option_18]) +optiondescription_17.impl_set_information('name', "test.service") +optiondescription_17.impl_set_information('source', "test.service") +optiondescription_16 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_19 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_33 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_19]) +optiondescription_33.impl_set_information('type', "service") +option_23 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_22 = OptionDescription(name="test2_service", doc="test2.service", children=[option_23]) +optiondescription_22.impl_set_information('engine', "jinja2") +optiondescription_22.impl_set_information('name', "test2.service") +optiondescription_22.impl_set_information('source', "test2.service") +optiondescription_21 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_22]) +option_20 = BoolOption(name="activate", doc="activate", default=True) +option_24 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_34 = OptionDescription(name="test2_service", doc="test2.service", children=[optiondescription_21, option_20, option_24]) +optiondescription_34.impl_set_information('type', "service") +optiondescription_32 = OptionDescription(name="services", doc="services", children=[optiondescription_33, optiondescription_34], properties=frozenset({"hidden"})) +optiondescription_30 = OptionDescription(name="2", doc="2", children=[optiondescription_31, optiondescription_32]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_25, optiondescription_30]) diff --git a/tests/dictionaries/20override_no_templating/tiramisu/base.py b/tests/dictionaries/20override_no_templating/tiramisu/base.py index e817258d7..b62d98028 100644 --- a/tests/dictionaries/20override_no_templating/tiramisu/base.py +++ b/tests/dictionaries/20override_no_templating/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) -option_7.impl_set_information('engine', "none") -option_7.impl_set_information('name', "test.service") -option_7.impl_set_information('source', "test.service") -option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_9, option_10]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6]) +optiondescription_5.impl_set_information('engine', "none") +optiondescription_5.impl_set_information('name', "test.service") +optiondescription_5.impl_set_information('source', "test.service") +optiondescription_4 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/20override_no_templating/tiramisu/multi.py b/tests/dictionaries/20override_no_templating/tiramisu/multi.py new file mode 100644 index 000000000..c503ba8e1 --- /dev/null +++ b/tests/dictionaries/20override_no_templating/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) +optiondescription_7.impl_set_information('engine', "none") +optiondescription_7.impl_set_information('name', "test.service") +optiondescription_7.impl_set_information('source', "test.service") +optiondescription_6 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_9]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[option_13]) +optiondescription_12.impl_set_information('engine', "none") +optiondescription_12.impl_set_information('name', "test.service") +optiondescription_12.impl_set_information('source', "test.service") +optiondescription_11 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_12]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_11, option_10, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/20override_source/tiramisu/base.py b/tests/dictionaries/20override_source/tiramisu/base.py index 20f21e867..3a90e8f77 100644 --- a/tests/dictionaries/20override_source/tiramisu/base.py +++ b/tests/dictionaries/20override_source/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8]) -option_7.impl_set_information('name', "test.service") -option_7.impl_set_information('source', "test2.service") -option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_9, option_10]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="test2_service", doc="test2.service", children=[option_6]) +optiondescription_5.impl_set_information('name', "test.service") +optiondescription_5.impl_set_information('source', "test2.service") +optiondescription_4 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/20override_source/tiramisu/multi.py b/tests/dictionaries/20override_source/tiramisu/multi.py new file mode 100644 index 000000000..f797e0162 --- /dev/null +++ b/tests/dictionaries/20override_source/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8]) +optiondescription_7.impl_set_information('name', "test.service") +optiondescription_7.impl_set_information('source', "test2.service") +optiondescription_6 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_9]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_12 = OptionDescription(name="test2_service", doc="test2.service", children=[option_13]) +optiondescription_12.impl_set_information('name', "test.service") +optiondescription_12.impl_set_information('source', "test2.service") +optiondescription_11 = OptionDescription(name="overrides", doc="overrides", children=[optiondescription_12]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_11, option_10, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/21family_empty/00-base.xml b/tests/dictionaries/21family_empty/00-base.xml index b4ade21f9..49813e8f7 100644 --- a/tests/dictionaries/21family_empty/00-base.xml +++ b/tests/dictionaries/21family_empty/00-base.xml @@ -7,6 +7,6 @@ - + diff --git a/tests/dictionaries/21family_empty/tiramisu/base.py b/tests/dictionaries/21family_empty/tiramisu/base.py index 7c893132f..16ca86140 100644 --- a/tests/dictionaries/21family_empty/tiramisu/base.py +++ b/tests/dictionaries/21family_empty/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/21family_empty/tiramisu/multi.py b/tests/dictionaries/21family_empty/tiramisu/multi.py new file mode 100644 index 000000000..c979513fe --- /dev/null +++ b/tests/dictionaries/21family_empty/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/21family_empty_sub/00-base.xml b/tests/dictionaries/21family_empty_sub/00-base.xml new file mode 100644 index 000000000..84680f51c --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/00-base.xml @@ -0,0 +1,14 @@ + + + + + + non + + + + + + + + diff --git a/tests/dictionaries/21family_empty_sub/__init__.py b/tests/dictionaries/21family_empty_sub/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/21family_empty_sub/makedict/after.json b/tests/dictionaries/21family_empty_sub/makedict/after.json new file mode 100644 index 000000000..2e6c541d0 --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "non" + } +} diff --git a/tests/dictionaries/21family_empty_sub/makedict/base.json b/tests/dictionaries/21family_empty_sub/makedict/base.json new file mode 100644 index 000000000..25056378d --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.general.mode_conteneur_actif": "non" +} diff --git a/tests/dictionaries/21family_empty_sub/makedict/before.json b/tests/dictionaries/21family_empty_sub/makedict/before.json new file mode 100644 index 000000000..2e6c541d0 --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "non" + } +} diff --git a/tests/dictionaries/21family_empty_sub/tiramisu/base.py b/tests/dictionaries/21family_empty_sub/tiramisu/base.py new file mode 100644 index 000000000..1689a878b --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/tiramisu/base.py @@ -0,0 +1,24 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/21family_empty_sub/tiramisu/multi.py b/tests/dictionaries/21family_empty_sub/tiramisu/multi.py new file mode 100644 index 000000000..fbdab7205 --- /dev/null +++ b/tests/dictionaries/21family_empty_sub/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/22provider_dynamic/tiramisu/base.py b/tests/dictionaries/22provider_dynamic/tiramisu/base.py index dbcaa5bea..491dd7564 100644 --- a/tests/dictionaries/22provider_dynamic/tiramisu/base.py +++ b/tests/dictionaries/22provider_dynamic/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) option_0.impl_set_information('provider:dyn', "rougail.dyn{suffix}.vardyn{suffix}") diff --git a/tests/dictionaries/22provider_dynamic/tiramisu/multi.py b/tests/dictionaries/22provider_dynamic/tiramisu/multi.py new file mode 100644 index 000000000..0b6476633 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic/tiramisu/multi.py @@ -0,0 +1,36 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +optiondescription_9.impl_set_information('provider:dyn', "rougail.dyn{suffix}.vardyn{suffix}") +option_6 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal"})) +option_8 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_7 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +optiondescription_11.impl_set_information('provider:dyn', "rougail.dyn{suffix}.vardyn{suffix}") +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/22provider_dynamic_2/00-base.xml b/tests/dictionaries/22provider_dynamic_2/00-base.xml new file mode 100644 index 000000000..972e74423 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/00-base.xml @@ -0,0 +1,14 @@ + + + + + val1 + val2 + + + + + + + + diff --git a/tests/dictionaries/22provider_dynamic_2/__init__.py b/tests/dictionaries/22provider_dynamic_2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/22provider_dynamic_2/makedict/after.json b/tests/dictionaries/22provider_dynamic_2/makedict/after.json new file mode 100644 index 000000000..5c81b6a85 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/makedict/after.json @@ -0,0 +1,17 @@ +{ + "rougail.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.general.dynval1.vardynval1": { + "owner": "default", + "value": null + }, + "rougail.general.dynval2.vardynval2": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/22provider_dynamic_2/makedict/base.json b/tests/dictionaries/22provider_dynamic_2/makedict/base.json new file mode 100644 index 000000000..2d7754e77 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/makedict/base.json @@ -0,0 +1,8 @@ +{ + "rougail.varname": [ + "val1", + "val2" + ], + "rougail.general.dynval1.vardynval1": null, + "rougail.general.dynval2.vardynval2": null +} diff --git a/tests/dictionaries/22provider_dynamic_2/makedict/before.json b/tests/dictionaries/22provider_dynamic_2/makedict/before.json new file mode 100644 index 000000000..5c81b6a85 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/makedict/before.json @@ -0,0 +1,17 @@ +{ + "rougail.varname": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.general.dynval1.vardynval1": { + "owner": "default", + "value": null + }, + "rougail.general.dynval2.vardynval2": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/22provider_dynamic_2/tiramisu/base.py b/tests/dictionaries/22provider_dynamic_2/tiramisu/base.py new file mode 100644 index 000000000..1171ef625 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/tiramisu/base.py @@ -0,0 +1,28 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_1 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_1, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) +option_0.impl_set_information('provider:dyn', "rougail.general.dyn{suffix}.vardyn{suffix}") diff --git a/tests/dictionaries/22provider_dynamic_2/tiramisu/multi.py b/tests/dictionaries/22provider_dynamic_2/tiramisu/multi.py new file mode 100644 index 000000000..7e01fbdd2 --- /dev/null +++ b/tests/dictionaries/22provider_dynamic_2/tiramisu/multi.py @@ -0,0 +1,36 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_1 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_1, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +optiondescription_9.impl_set_information('provider:dyn', "rougail.general.dyn{suffix}.vardyn{suffix}") +option_5 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"})) +optiondescription_7 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_5, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[optiondescription_7], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_5, optiondescription_6]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +optiondescription_11.impl_set_information('provider:dyn', "rougail.general.dyn{suffix}.vardyn{suffix}") +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/30mandatory_withoutvalue/tiramisu/base.py b/tests/dictionaries/30mandatory_withoutvalue/tiramisu/base.py index ccc35611c..3464f97b9 100644 --- a/tests/dictionaries/30mandatory_withoutvalue/tiramisu/base.py +++ b/tests/dictionaries/30mandatory_withoutvalue/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"basic", "mandatory"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/30mandatory_withoutvalue/tiramisu/multi.py b/tests/dictionaries/30mandatory_withoutvalue/tiramisu/multi.py new file mode 100644 index 000000000..9902cb81a --- /dev/null +++ b/tests/dictionaries/30mandatory_withoutvalue/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"basic", "mandatory"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"basic"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/base.py b/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/base.py index 52891c7c1..1bba267aa 100644 --- a/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/base.py +++ b/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/multi.py b/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/multi.py new file mode 100644 index 000000000..faa21a995 --- /dev/null +++ b/tests/dictionaries/30mandatory_withoutvaluecalc/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/30mandatory_withvalue/tiramisu/base.py b/tests/dictionaries/30mandatory_withvalue/tiramisu/base.py index e48d626c3..3c44cb2cc 100644 --- a/tests/dictionaries/30mandatory_withvalue/tiramisu/base.py +++ b/tests/dictionaries/30mandatory_withvalue/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="value", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="value", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/30mandatory_withvalue/tiramisu/multi.py b/tests/dictionaries/30mandatory_withvalue/tiramisu/multi.py new file mode 100644 index 000000000..ce8e7d18f --- /dev/null +++ b/tests/dictionaries/30mandatory_withvalue/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="value", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="value", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/base.py b/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/base.py index 43f7fd03d..53a9e1379 100644 --- a/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/base.py +++ b/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/multi.py b/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/multi.py new file mode 100644 index 000000000..264e1792b --- /dev/null +++ b/tests/dictionaries/30mandatory_withvaluecalc/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("value")))), properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/40condition_base/tiramisu/base.py b/tests/dictionaries/40condition_base/tiramisu/base.py index 4f6572535..ca5577b6c 100644 --- a/tests/dictionaries/40condition_base/tiramisu/base.py +++ b/tests/dictionaries/40condition_base/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40condition_base/tiramisu/multi.py b/tests/dictionaries/40condition_base/tiramisu/multi.py new file mode 100644 index 000000000..f4880da90 --- /dev/null +++ b/tests/dictionaries/40condition_base/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40condition_base_add/tiramisu/base.py b/tests/dictionaries/40condition_base_add/tiramisu/base.py index 4f6572535..ca5577b6c 100644 --- a/tests/dictionaries/40condition_base_add/tiramisu/base.py +++ b/tests/dictionaries/40condition_base_add/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40condition_base_add/tiramisu/multi.py b/tests/dictionaries/40condition_base_add/tiramisu/multi.py new file mode 100644 index 000000000..f4880da90 --- /dev/null +++ b/tests/dictionaries/40condition_base_add/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40condition_fallback/tiramisu/base.py b/tests/dictionaries/40condition_fallback/tiramisu/base.py index 563fa1e1a..bed91918c 100644 --- a/tests/dictionaries/40condition_fallback/tiramisu/base.py +++ b/tests/dictionaries/40condition_fallback/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_7 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_6 = OptionDescription(name="disabled_family", doc="disabled_family", children=[option_7], properties=frozenset({"disabled", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="disabled_family", doc="disabled_family", children=[option_6], properties=frozenset({"disabled", "normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/40condition_fallback/tiramisu/multi.py b/tests/dictionaries/40condition_fallback/tiramisu/multi.py new file mode 100644 index 000000000..bbd50fbd2 --- /dev/null +++ b/tests/dictionaries/40condition_fallback/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="disabled_family", doc="disabled_family", children=[option_6], properties=frozenset({"disabled", "normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_8 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8, option_9, option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="disabled_family", doc="disabled_family", children=[option_12], properties=frozenset({"disabled", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7, optiondescription_11]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/40condition_optional/tiramisu/base.py b/tests/dictionaries/40condition_optional/tiramisu/base.py index ce122e65e..495fc024d 100644 --- a/tests/dictionaries/40condition_optional/tiramisu/base.py +++ b/tests/dictionaries/40condition_optional/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/40condition_optional/tiramisu/multi.py b/tests/dictionaries/40condition_optional/tiramisu/multi.py new file mode 100644 index 000000000..c6142cc11 --- /dev/null +++ b/tests/dictionaries/40condition_optional/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/40condition_optional_empty/tiramisu/base.py b/tests/dictionaries/40condition_optional_empty/tiramisu/base.py index f0f6000ae..222dc035a 100644 --- a/tests/dictionaries/40condition_optional_empty/tiramisu/base.py +++ b/tests/dictionaries/40condition_optional_empty/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/40condition_optional_empty/tiramisu/multi.py b/tests/dictionaries/40condition_optional_empty/tiramisu/multi.py new file mode 100644 index 000000000..4d65a76c6 --- /dev/null +++ b/tests/dictionaries/40condition_optional_empty/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/40condition_optional_family/tiramisu/base.py b/tests/dictionaries/40condition_optional_family/tiramisu/base.py index f3f20b5e4..f91588c47 100644 --- a/tests/dictionaries/40condition_optional_family/tiramisu/base.py +++ b/tests/dictionaries/40condition_optional_family/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) -option_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/40condition_optional_family/tiramisu/multi.py b/tests/dictionaries/40condition_optional_family/tiramisu/multi.py new file mode 100644 index 000000000..798e4a5af --- /dev/null +++ b/tests/dictionaries/40condition_optional_family/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_4 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, optiondescription_5]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/40empty_param/tiramisu/base.py b/tests/dictionaries/40empty_param/tiramisu/base.py index e3bed16d5..fd2da7712 100644 --- a/tests/dictionaries/40empty_param/tiramisu/base.py +++ b/tests/dictionaries/40empty_param/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(None)))), allow_private=True, properties=frozenset({"expert"})) -option_4 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_3, option_4], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(None)))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/40empty_param/tiramisu/multi.py b/tests/dictionaries/40empty_param/tiramisu/multi.py new file mode 100644 index 000000000..da6b245a1 --- /dev/null +++ b/tests/dictionaries/40empty_param/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(None)))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(None)))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_6 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_4 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_5, option_6], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/40empty_param2/tiramisu/base.py b/tests/dictionaries/40empty_param2/tiramisu/base.py index 4a7f570a6..098f46e5c 100644 --- a/tests/dictionaries/40empty_param2/tiramisu/base.py +++ b/tests/dictionaries/40empty_param2/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((), kwargs={'value': ParamValue(None)})), allow_private=True, properties=frozenset({"expert"})) -option_4 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_3, option_4], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((), kwargs={'value': ParamValue(None)})), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/40empty_param2/tiramisu/multi.py b/tests/dictionaries/40empty_param2/tiramisu/multi.py new file mode 100644 index 000000000..a158c52a5 --- /dev/null +++ b/tests/dictionaries/40empty_param2/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((), kwargs={'value': ParamValue(None)})), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((), kwargs={'value': ParamValue(None)})), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_6 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_4 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_5, option_6], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/base.py b/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/base.py index 613a15152..5988123a8 100644 --- a/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/base.py +++ b/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", multi=True, default=['non'], properties=frozenset({"force_default_on_freeze", "frozen", "mandatory"})) -option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", multi=True, default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "normal"})) -option_4 = Leadership(name="mode_conteneur_actif1", doc="No change", children=[option_5, option_6], properties=frozenset({"hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", multi=True, default=['non'], properties=frozenset({"force_default_on_freeze", "frozen", "mandatory"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", multi=True, default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "normal"})) +optiondescription_3 = Leadership(name="mode_conteneur_actif1", doc="No change", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/multi.py b/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/multi.py new file mode 100644 index 000000000..d72861b06 --- /dev/null +++ b/tests/dictionaries/40hidden_if_in_leadership_fallback/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", multi=True, default=['non'], properties=frozenset({"force_default_on_freeze", "frozen", "mandatory"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", multi=True, default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "normal"})) +optiondescription_3 = Leadership(name="mode_conteneur_actif1", doc="No change", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, optiondescription_3], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", multi=True, default=['non'], properties=frozenset({"force_default_on_freeze", "frozen", "mandatory"})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", multi=True, default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "normal"})) +optiondescription_8 = Leadership(name="mode_conteneur_actif1", doc="No change", children=[option_9, option_10], properties=frozenset({"hidden", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, optiondescription_8], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40ifin_leadership/tiramisu/base.py b/tests/dictionaries/40ifin_leadership/tiramisu/base.py index b181f82e3..6f84c73e6 100644 --- a/tests/dictionaries/40ifin_leadership/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadership/tiramisu/base.py @@ -2,24 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8]) diff --git a/tests/dictionaries/40ifin_leadership/tiramisu/multi.py b/tests/dictionaries/40ifin_leadership/tiramisu/multi.py new file mode 100644 index 000000000..f21bd9afa --- /dev/null +++ b/tests/dictionaries/40ifin_leadership/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_10, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9, option_10, optiondescription_11], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +optiondescription_17 = OptionDescription(name="2", doc="2", children=[optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_17]) diff --git a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py index fb00842b1..e93506916 100644 --- a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, default=['a'], properties=frozenset({"mandatory"})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_13 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_14 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14]) -option_12.impl_set_information('source', "mailname") -option_11 = OptionDescription(name="files", doc="files", children=[option_12]) -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_16 = BoolOption(name="manage", doc="manage", default=True) -option_10 = OptionDescription(name="test_service", doc="test.service", children=[option_11, option_15, option_16]) -option_9 = OptionDescription(name="services", doc="services", children=[option_10], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_9]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=['a'], properties=frozenset({"mandatory"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_13]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_14, optiondescription_15]) diff --git a/tests/dictionaries/40ifin_leadershipauto/tiramisu/multi.py b/tests/dictionaries/40ifin_leadershipauto/tiramisu/multi.py new file mode 100644 index 000000000..21b020c44 --- /dev/null +++ b/tests/dictionaries/40ifin_leadershipauto/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=['a'], properties=frozenset({"mandatory"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="1", doc="1", children=[optiondescription_28, optiondescription_29]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, default=['a'], properties=frozenset({"mandatory"})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_10, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9, option_10, optiondescription_11], properties=frozenset({"normal"})) +optiondescription_32 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_25 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_24 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_23 = OptionDescription(name="mailname", doc="mailname", children=[option_25, option_24]) +optiondescription_23.impl_set_information('source', "mailname") +optiondescription_22 = OptionDescription(name="files", doc="files", children=[optiondescription_23]) +option_21 = BoolOption(name="activate", doc="activate", default=True) +option_26 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_34 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_22, option_21, option_26]) +optiondescription_34.impl_set_information('type', "service") +optiondescription_33 = OptionDescription(name="services", doc="services", children=[optiondescription_34], properties=frozenset({"hidden"})) +optiondescription_31 = OptionDescription(name="2", doc="2", children=[optiondescription_32, optiondescription_33]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_27, optiondescription_31]) diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py index 67d307656..5cb5a475b 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py @@ -2,38 +2,43 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) -option_6 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b'], properties=frozenset({"mandatory"})) -option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("a")}))})) -option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) -option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_13 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b'], properties=frozenset({"mandatory"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("a")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname2") option_14 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14]) -option_12.impl_set_information('source', "mailname") -option_16 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_15 = OptionDescription(name="mailname2", doc="mailname2", children=[option_16, option_17]) -option_15.impl_set_information('engine', "jinja2") -option_15.impl_set_information('source', "mailname2") -option_11 = OptionDescription(name="files", doc="files", children=[option_12, option_15]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_10 = OptionDescription(name="test_service", doc="test.service", children=[option_11, option_18, option_19]) -option_9 = OptionDescription(name="services", doc="services", children=[option_10], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_9]) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10, optiondescription_13]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_19 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_16]) +optiondescription_19.impl_set_information('type', "service") +optiondescription_18 = OptionDescription(name="services", doc="services", children=[optiondescription_19], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_18]) diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/multi.py b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/multi.py new file mode 100644 index 000000000..589e2e3f9 --- /dev/null +++ b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/multi.py @@ -0,0 +1,69 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_5 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b'], properties=frozenset({"mandatory"})) +option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("a")}))})) +option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, optiondescription_4], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +option_22 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_21]) +optiondescription_20.impl_set_information('engine', "jinja2") +optiondescription_20.impl_set_information('source', "mailname2") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17, optiondescription_20]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_23 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_23]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="1", doc="1", children=[optiondescription_34, optiondescription_35]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_10 = StrOption(name="condition", doc="condition", default="oui", properties=frozenset({"mandatory", "normal"})) +option_12 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b'], properties=frozenset({"mandatory"})) +option_13 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_12, todict=True, notraisepropertyerror=True), 'expected': ParamValue("a")}))})) +option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"normal"})) +optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="general", doc="general", children=[option_9, option_10, optiondescription_11], properties=frozenset({"normal"})) +optiondescription_38 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_28 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_27 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_26 = OptionDescription(name="mailname", doc="mailname", children=[option_28, option_27]) +optiondescription_26.impl_set_information('source', "mailname") +option_31 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="mailname2", doc="mailname2", children=[option_31, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "mailname2") +optiondescription_25 = OptionDescription(name="files", doc="files", children=[optiondescription_26, optiondescription_29]) +option_24 = BoolOption(name="activate", doc="activate", default=True) +option_32 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_40 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_25, option_24, option_32]) +optiondescription_40.impl_set_information('type', "service") +optiondescription_39 = OptionDescription(name="services", doc="services", children=[optiondescription_40], properties=frozenset({"hidden"})) +optiondescription_37 = OptionDescription(name="2", doc="2", children=[optiondescription_38, optiondescription_39]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_33, optiondescription_37]) diff --git a/tests/dictionaries/40ifin_multi/tiramisu/base.py b/tests/dictionaries/40ifin_multi/tiramisu/base.py index 45dab99d0..b954b356f 100644 --- a/tests/dictionaries/40ifin_multi/tiramisu/base.py +++ b/tests/dictionaries/40ifin_multi/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_4 = OptionDescription(name="general2", doc="general2", children=[option_5, option_6], properties=frozenset({"hidden", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40ifin_multi/tiramisu/multi.py b/tests/dictionaries/40ifin_multi/tiramisu/multi.py new file mode 100644 index 000000000..98af26fc1 --- /dev/null +++ b/tests/dictionaries/40ifin_multi/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7], properties=frozenset({"normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_8 = OptionDescription(name="general2", doc="general2", children=[option_9, option_10], properties=frozenset({"hidden", "normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6, optiondescription_8]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40ifin_multi2/tiramisu/base.py b/tests/dictionaries/40ifin_multi2/tiramisu/base.py index 744a41c3e..d59c1d69b 100644 --- a/tests/dictionaries/40ifin_multi2/tiramisu/base.py +++ b/tests/dictionaries/40ifin_multi2/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_4 = OptionDescription(name="general2", doc="general2", children=[option_5, option_6], properties=frozenset({"hidden", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40ifin_multi2/tiramisu/multi.py b/tests/dictionaries/40ifin_multi2/tiramisu/multi.py new file mode 100644 index 000000000..e24a1eb1f --- /dev/null +++ b/tests/dictionaries/40ifin_multi2/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7], properties=frozenset({"normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_9, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_8 = OptionDescription(name="general2", doc="general2", children=[option_9, option_10], properties=frozenset({"hidden", "normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6, optiondescription_8]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40ifin_validenum/tiramisu/base.py b/tests/dictionaries/40ifin_validenum/tiramisu/base.py index 7bf0b82f2..27dc569e0 100644 --- a/tests/dictionaries/40ifin_validenum/tiramisu/base.py +++ b/tests/dictionaries/40ifin_validenum/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) -option_6 = ChoiceOption(name="mode_conteneur_actif3", doc="No change", values=('a', 'b', 'c'), default="a", properties=frozenset({"mandatory", "normal"})) -option_4 = OptionDescription(name="general2", doc="general2", children=[option_5, option_6], properties=frozenset({"hidden", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_5 = ChoiceOption(name="mode_conteneur_actif3", doc="No change", values=('a', 'b', 'c'), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/40ifin_validenum/tiramisu/multi.py b/tests/dictionaries/40ifin_validenum/tiramisu/multi.py new file mode 100644 index 000000000..3e50be400 --- /dev/null +++ b/tests/dictionaries/40ifin_validenum/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_5 = ChoiceOption(name="mode_conteneur_actif3", doc="No change", values=('a', 'b', 'c'), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4, option_5], properties=frozenset({"hidden", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7], properties=frozenset({"normal"})) +option_9 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"disabled", "mandatory", "normal"})) +option_10 = ChoiceOption(name="mode_conteneur_actif3", doc="No change", values=('a', 'b', 'c'), default="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general2", doc="general2", children=[option_9, option_10], properties=frozenset({"hidden", "normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6, optiondescription_8]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/40space_param/tiramisu/base.py b/tests/dictionaries/40space_param/tiramisu/base.py index fb4f7f00d..881e2efc9 100644 --- a/tests/dictionaries/40space_param/tiramisu/base.py +++ b/tests/dictionaries/40space_param/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(" ")))), allow_private=True, properties=frozenset({"expert"})) -option_4 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, properties=frozenset({"expert", "mandatory"})) -option_2 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_3, option_4], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(" ")))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/40space_param/tiramisu/multi.py b/tests/dictionaries/40space_param/tiramisu/multi.py new file mode 100644 index 000000000..51ab5fdaa --- /dev/null +++ b/tests/dictionaries/40space_param/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(" ")))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_3 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_1 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_2, option_3], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = PortOption(name="toto1", doc="Port d'écoute du proxy", default=Calculation(func.calc_multi_condition, Params((ParamValue(" ")))), allow_private=True, allow_protocol=True, properties=frozenset({"expert"})) +option_6 = PortOption(name="toto2", doc="Port d'écoute du proxy NTLM", default="3127", allow_private=True, allow_protocol=True, properties=frozenset({"expert", "mandatory"})) +optiondescription_4 = OptionDescription(name="proxy_authentifie", doc="proxy authentifié", children=[option_5, option_6], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/45extra_without_family/tiramisu/base.py b/tests/dictionaries/45extra_without_family/tiramisu/base.py index 8a431e2ad..32cc9bd95 100644 --- a/tests/dictionaries/45extra_without_family/tiramisu/base.py +++ b/tests/dictionaries/45extra_without_family/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="my_var", doc="my_var", default="rougail", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_4 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"})) -option_3 = OptionDescription(name="extra", doc="extra", children=[option_4]) -option_9 = FilenameOption(name="name", doc="name", default="/etc/file") -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="file", doc="file", children=[option_9, option_10]) -option_8.impl_set_information('source', "file") -option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_12 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_11, option_12]) -option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3, option_5]) +option_1 = StrOption(name="my_var", doc="my_var", default="rougail", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="extra", doc="extra", children=[option_2]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10, optiondescription_11]) diff --git a/tests/dictionaries/45extra_without_family/tiramisu/multi.py b/tests/dictionaries/45extra_without_family/tiramisu/multi.py new file mode 100644 index 000000000..1e9f254e1 --- /dev/null +++ b/tests/dictionaries/45extra_without_family/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="my_var", doc="my_var", default="rougail", properties=frozenset({"mandatory", "normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"})) +optiondescription_19 = OptionDescription(name="extra", doc="extra", children=[option_2]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_21 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_21.impl_set_information('type', "service") +optiondescription_20 = OptionDescription(name="services", doc="services", children=[optiondescription_21], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19, optiondescription_20]) +option_3 = StrOption(name="my_var", doc="my_var", default="rougail", properties=frozenset({"mandatory", "normal"})) +optiondescription_23 = OptionDescription(name="rougail", doc="Rougail", children=[option_3]) +option_4 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="extra", doc="extra", children=[option_4]) +option_15 = FilenameOption(name="name", doc="name", default="/etc/file") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="file", doc="file", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_22 = OptionDescription(name="2", doc="2", children=[optiondescription_23, optiondescription_24, optiondescription_25]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_22]) diff --git a/tests/dictionaries/45multi_family/tiramisu/base.py b/tests/dictionaries/45multi_family/tiramisu/base.py index 038bf9943..cb7cd17cb 100644 --- a/tests/dictionaries/45multi_family/tiramisu/base.py +++ b/tests/dictionaries/45multi_family/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) -option_3 = OptionDescription(name="subfamily", doc="subfamily", children=[option_4], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="base", doc="base", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/45multi_family/tiramisu/multi.py b/tests/dictionaries/45multi_family/tiramisu/multi.py new file mode 100644 index 000000000..aa950012d --- /dev/null +++ b/tests/dictionaries/45multi_family/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="subfamily", doc="subfamily", children=[option_6], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="base", doc="base", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/45multi_family_basic/tiramisu/base.py b/tests/dictionaries/45multi_family_basic/tiramisu/base.py index b306cbc05..589eea8fc 100644 --- a/tests/dictionaries/45multi_family_basic/tiramisu/base.py +++ b/tests/dictionaries/45multi_family_basic/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="variable", doc="variable", properties=frozenset({"basic"})) -option_3 = OptionDescription(name="subfamily", doc="subfamily", children=[option_4], properties=frozenset({"basic"})) -option_2 = OptionDescription(name="base", doc="base", children=[option_3], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"basic"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"basic"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/45multi_family_basic/tiramisu/multi.py b/tests/dictionaries/45multi_family_basic/tiramisu/multi.py new file mode 100644 index 000000000..59a125ed5 --- /dev/null +++ b/tests/dictionaries/45multi_family_basic/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"basic"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"basic"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="variable", doc="variable", properties=frozenset({"basic"})) +optiondescription_5 = OptionDescription(name="subfamily", doc="subfamily", children=[option_6], properties=frozenset({"basic"})) +optiondescription_4 = OptionDescription(name="base", doc="base", children=[optiondescription_5], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/45multi_family_expert/tiramisu/base.py b/tests/dictionaries/45multi_family_expert/tiramisu/base.py index d0f63384b..f56250d89 100644 --- a/tests/dictionaries/45multi_family_expert/tiramisu/base.py +++ b/tests/dictionaries/45multi_family_expert/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = StrOption(name="variable", doc="variable", properties=frozenset({"expert"})) -option_3 = OptionDescription(name="subfamily", doc="subfamily", children=[option_4], properties=frozenset({"expert"})) -option_2 = OptionDescription(name="base", doc="base", children=[option_3], properties=frozenset({"expert"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"expert"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"expert"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/45multi_family_expert/tiramisu/multi.py b/tests/dictionaries/45multi_family_expert/tiramisu/multi.py new file mode 100644 index 000000000..452205601 --- /dev/null +++ b/tests/dictionaries/45multi_family_expert/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="variable", doc="variable", properties=frozenset({"expert"})) +optiondescription_2 = OptionDescription(name="subfamily", doc="subfamily", children=[option_3], properties=frozenset({"expert"})) +optiondescription_1 = OptionDescription(name="base", doc="base", children=[optiondescription_2], properties=frozenset({"expert"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_6 = StrOption(name="variable", doc="variable", properties=frozenset({"expert"})) +optiondescription_5 = OptionDescription(name="subfamily", doc="subfamily", children=[option_6], properties=frozenset({"expert"})) +optiondescription_4 = OptionDescription(name="base", doc="base", children=[optiondescription_5], properties=frozenset({"expert"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/45multi_family_order/tiramisu/base.py b/tests/dictionaries/45multi_family_order/tiramisu/base.py index b37a9e89a..d40ccf2cb 100644 --- a/tests/dictionaries/45multi_family_order/tiramisu/base.py +++ b/tests/dictionaries/45multi_family_order/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal"})) -option_4 = StrOption(name="variable2", doc="variable2", properties=frozenset({"normal"})) -option_6 = StrOption(name="variable3", doc="variable3", properties=frozenset({"normal"})) -option_5 = OptionDescription(name="subfamily", doc="subfamily", children=[option_6], properties=frozenset({"normal"})) -option_7 = StrOption(name="variable4", doc="variable4", properties=frozenset({"normal"})) -option_3 = OptionDescription(name="base", doc="base", children=[option_4, option_5, option_7], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal"})) +option_3 = StrOption(name="variable2", doc="variable2", properties=frozenset({"normal"})) +option_5 = StrOption(name="variable3", doc="variable3", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="subfamily", doc="subfamily", children=[option_5], properties=frozenset({"normal"})) +option_6 = StrOption(name="variable4", doc="variable4", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="base", doc="base", children=[option_3, optiondescription_4, option_6], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7]) diff --git a/tests/dictionaries/45multi_family_order/tiramisu/multi.py b/tests/dictionaries/45multi_family_order/tiramisu/multi.py new file mode 100644 index 000000000..13e9f8a0d --- /dev/null +++ b/tests/dictionaries/45multi_family_order/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal"})) +option_3 = StrOption(name="variable2", doc="variable2", properties=frozenset({"normal"})) +option_5 = StrOption(name="variable3", doc="variable3", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="subfamily", doc="subfamily", children=[option_5], properties=frozenset({"normal"})) +option_6 = StrOption(name="variable4", doc="variable4", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="base", doc="base", children=[option_3, optiondescription_4, option_6], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14]) +option_7 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal"})) +option_9 = StrOption(name="variable2", doc="variable2", properties=frozenset({"normal"})) +option_11 = StrOption(name="variable3", doc="variable3", properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="subfamily", doc="subfamily", children=[option_11], properties=frozenset({"normal"})) +option_12 = StrOption(name="variable4", doc="variable4", properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="base", doc="base", children=[option_9, optiondescription_10, option_12], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_7, optiondescription_8]) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_15]) diff --git a/tests/dictionaries/45without_family/tiramisu/base.py b/tests/dictionaries/45without_family/tiramisu/base.py index 8edbf71ec..0fc6159ff 100644 --- a/tests/dictionaries/45without_family/tiramisu/base.py +++ b/tests/dictionaries/45without_family/tiramisu/base.py @@ -2,18 +2,22 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_1 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/dictionaries/45without_family/tiramisu/multi.py b/tests/dictionaries/45without_family/tiramisu/multi.py new file mode 100644 index 000000000..1f22e43a6 --- /dev/null +++ b/tests/dictionaries/45without_family/tiramisu/multi.py @@ -0,0 +1,27 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +optiondescription_3 = OptionDescription(name="1", doc="1", children=[optiondescription_4]) +option_2 = StrOption(name="variable", doc="variable", properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3, optiondescription_5]) diff --git a/tests/dictionaries/50exists_exists/tiramisu/base.py b/tests/dictionaries/50exists_exists/tiramisu/base.py index 5a5c3e5ef..daa68d602 100644 --- a/tests/dictionaries/50exists_exists/tiramisu/base.py +++ b/tests/dictionaries/50exists_exists/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/50exists_exists/tiramisu/multi.py b/tests/dictionaries/50exists_exists/tiramisu/multi.py new file mode 100644 index 000000000..9b9ca44e7 --- /dev/null +++ b/tests/dictionaries/50exists_exists/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/50redefine_description/tiramisu/base.py b/tests/dictionaries/50redefine_description/tiramisu/base.py index 2fc7be9d0..513bbb6de 100644 --- a/tests/dictionaries/50redefine_description/tiramisu/base.py +++ b/tests/dictionaries/50redefine_description/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefined", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefined", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/50redefine_description/tiramisu/multi.py b/tests/dictionaries/50redefine_description/tiramisu/multi.py new file mode 100644 index 000000000..0e3ebb174 --- /dev/null +++ b/tests/dictionaries/50redefine_description/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefined", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefined", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51exists_nonexists/tiramisu/base.py b/tests/dictionaries/51exists_nonexists/tiramisu/base.py index 9c431cbbf..af596456c 100644 --- a/tests/dictionaries/51exists_nonexists/tiramisu/base.py +++ b/tests/dictionaries/51exists_nonexists/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="New description", default="oui", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="New description", default="oui", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/51exists_nonexists/tiramisu/multi.py b/tests/dictionaries/51exists_nonexists/tiramisu/multi.py new file mode 100644 index 000000000..9794e8198 --- /dev/null +++ b/tests/dictionaries/51exists_nonexists/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="New description", default="oui", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) +option_7 = StrOption(name="mode_conteneur_actif1", doc="Description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="New description", default="oui", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/51exists_redefine/tiramisu/base.py b/tests/dictionaries/51exists_redefine/tiramisu/base.py index a70001a4f..76de1c99a 100644 --- a/tests/dictionaries/51exists_redefine/tiramisu/base.py +++ b/tests/dictionaries/51exists_redefine/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51exists_redefine/tiramisu/multi.py b/tests/dictionaries/51exists_redefine/tiramisu/multi.py new file mode 100644 index 000000000..36f3a82fe --- /dev/null +++ b/tests/dictionaries/51exists_redefine/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_auto/tiramisu/base.py b/tests/dictionaries/51redefine_auto/tiramisu/base.py index 9be304967..76425544b 100644 --- a/tests/dictionaries/51redefine_auto/tiramisu/base.py +++ b/tests/dictionaries/51redefine_auto/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_auto/tiramisu/multi.py b/tests/dictionaries/51redefine_auto/tiramisu/multi.py new file mode 100644 index 000000000..620fd6f86 --- /dev/null +++ b/tests/dictionaries/51redefine_auto/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_autofill/tiramisu/base.py b/tests/dictionaries/51redefine_autofill/tiramisu/base.py index 8cabffaa2..dd049ce00 100644 --- a/tests/dictionaries/51redefine_autofill/tiramisu/base.py +++ b/tests/dictionaries/51redefine_autofill/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_autofill/tiramisu/multi.py b/tests/dictionaries/51redefine_autofill/tiramisu/multi.py new file mode 100644 index 000000000..70364299a --- /dev/null +++ b/tests/dictionaries/51redefine_autofill/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_family/tiramisu/base.py b/tests/dictionaries/51redefine_family/tiramisu/base.py index 456506cd8..097b27114 100644 --- a/tests/dictionaries/51redefine_family/tiramisu/base.py +++ b/tests/dictionaries/51redefine_family/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = OptionDescription(name="general2", doc="general2", children=[option_5], properties=frozenset({"hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_4]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4], properties=frozenset({"hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/51redefine_family/tiramisu/multi.py b/tests/dictionaries/51redefine_family/tiramisu/multi.py new file mode 100644 index 000000000..564fc78d7 --- /dev/null +++ b/tests/dictionaries/51redefine_family/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +option_4 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general2", doc="general2", children=[option_4], properties=frozenset({"hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1, optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6], properties=frozenset({"normal"})) +option_8 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general2", doc="general2", children=[option_8], properties=frozenset({"hidden", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5, optiondescription_7]) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_11]) diff --git a/tests/dictionaries/51redefine_fill/tiramisu/base.py b/tests/dictionaries/51redefine_fill/tiramisu/base.py index 9be304967..76425544b 100644 --- a/tests/dictionaries/51redefine_fill/tiramisu/base.py +++ b/tests/dictionaries/51redefine_fill/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_fill/tiramisu/multi.py b/tests/dictionaries/51redefine_fill/tiramisu/multi.py new file mode 100644 index 000000000..620fd6f86 --- /dev/null +++ b/tests/dictionaries/51redefine_fill/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_fillauto/tiramisu/base.py b/tests/dictionaries/51redefine_fillauto/tiramisu/base.py index 9be304967..76425544b 100644 --- a/tests/dictionaries/51redefine_fillauto/tiramisu/base.py +++ b/tests/dictionaries/51redefine_fillauto/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_fillauto/tiramisu/multi.py b/tests/dictionaries/51redefine_fillauto/tiramisu/multi.py new file mode 100644 index 000000000..620fd6f86 --- /dev/null +++ b/tests/dictionaries/51redefine_fillauto/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.concat, Params((), kwargs={'valeur': ParamValue("non")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_help/tiramisu/base.py b/tests/dictionaries/51redefine_help/tiramisu/base.py index 6ed3357f4..7561c7095 100644 --- a/tests/dictionaries/51redefine_help/tiramisu/base.py +++ b/tests/dictionaries/51redefine_help/tiramisu/base.py @@ -2,21 +2,25 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="redefine help", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_3.impl_set_information('help', "redefine help ok") -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_2.impl_set_information('help', "redefine help family ok") -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="redefine help", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_2.impl_set_information('help', "redefine help ok") +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_1.impl_set_information('help', "redefine help family ok") +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_help/tiramisu/multi.py b/tests/dictionaries/51redefine_help/tiramisu/multi.py new file mode 100644 index 000000000..3de65ae33 --- /dev/null +++ b/tests/dictionaries/51redefine_help/tiramisu/multi.py @@ -0,0 +1,33 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="redefine help", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_2.impl_set_information('help', "redefine help ok") +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_1.impl_set_information('help', "redefine help family ok") +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="redefine help", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4.impl_set_information('help', "redefine help ok") +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_3.impl_set_information('help', "redefine help family ok") +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_hidden/tiramisu/base.py b/tests/dictionaries/51redefine_hidden/tiramisu/base.py index ce018c8a7..ba30a63be 100644 --- a/tests/dictionaries/51redefine_hidden/tiramisu/base.py +++ b/tests/dictionaries/51redefine_hidden/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine hidden", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine hidden", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_hidden/tiramisu/multi.py b/tests/dictionaries/51redefine_hidden/tiramisu/multi.py new file mode 100644 index 000000000..2d8a80aab --- /dev/null +++ b/tests/dictionaries/51redefine_hidden/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine hidden", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine hidden", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_multi/tiramisu/base.py b/tests/dictionaries/51redefine_multi/tiramisu/base.py index 5d8e715c5..f0afc8071 100644 --- a/tests/dictionaries/51redefine_multi/tiramisu/base.py +++ b/tests/dictionaries/51redefine_multi/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_multi/tiramisu/multi.py b/tests/dictionaries/51redefine_multi/tiramisu/multi.py new file mode 100644 index 000000000..131218f00 --- /dev/null +++ b/tests/dictionaries/51redefine_multi/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_remove_condition/tiramisu/base.py b/tests/dictionaries/51redefine_remove_condition/tiramisu/base.py index d7c73b294..7c430222d 100644 --- a/tests/dictionaries/51redefine_remove_condition/tiramisu/base.py +++ b/tests/dictionaries/51redefine_remove_condition/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/51redefine_remove_condition/tiramisu/multi.py b/tests/dictionaries/51redefine_remove_condition/tiramisu/multi.py new file mode 100644 index 000000000..a4f7b934a --- /dev/null +++ b/tests/dictionaries/51redefine_remove_condition/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/base.py b/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/base.py index 0e8900459..dc0dc88b9 100644 --- a/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/base.py +++ b/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/base.py @@ -2,31 +2,36 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_11 = FilenameOption(name="name", doc="name", default="/etc/file") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="file", doc="file", children=[option_11, option_12]) -option_10.impl_set_information('source', "file") -option_9 = OptionDescription(name="files", doc="files", children=[option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_8 = OptionDescription(name="test_service", doc="test.service", children=[option_9, option_13, option_14]) -option_7 = OptionDescription(name="services", doc="services", children=[option_8], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_7]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_10 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_8 = OptionDescription(name="file", doc="file", children=[option_10, option_9]) +optiondescription_8.impl_set_information('source', "file") +optiondescription_7 = OptionDescription(name="files", doc="files", children=[optiondescription_8]) +option_6 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_7, option_6, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/multi.py b/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/multi.py new file mode 100644 index 000000000..e4c70e9bf --- /dev/null +++ b/tests/dictionaries/51redefine_remove_condition_filelist/tiramisu/multi.py @@ -0,0 +1,55 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4, option_5], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_15 = FilenameOption(name="name", doc="name", default="/etc/file") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="file", doc="file", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_9 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="general", children=[option_7, option_8, option_9, option_10], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +option_21 = FilenameOption(name="name", doc="name", default="/etc/file") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "file") +optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19]) +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py index c68773b81..a9aeda306 100644 --- a/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py +++ b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_6 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) -option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3, option_4, option_5, option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3, option_4, option_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6]) diff --git a/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/multi.py b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/multi.py new file mode 100644 index 000000000..a1e62cdc9 --- /dev/null +++ b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3, option_4, option_5]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12]) +option_10 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_6 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_10, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_7 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_9 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[option_6, option_7, option_8, option_9, option_10]) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_13]) diff --git a/tests/dictionaries/51redefine_validenum/tiramisu/base.py b/tests/dictionaries/51redefine_validenum/tiramisu/base.py index e0b52a12a..bfca0be2e 100644 --- a/tests/dictionaries/51redefine_validenum/tiramisu/base.py +++ b/tests/dictionaries/51redefine_validenum/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = ChoiceOption(name="mode_conteneur_actif", doc="Redefine description", values=('a', 'b'), default="a", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="Redefine description", values=('a', 'b'), default="a", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/51redefine_validenum/tiramisu/multi.py b/tests/dictionaries/51redefine_validenum/tiramisu/multi.py new file mode 100644 index 000000000..0855c8ccd --- /dev/null +++ b/tests/dictionaries/51redefine_validenum/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = ChoiceOption(name="mode_conteneur_actif", doc="Redefine description", values=('a', 'b'), default="a", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = ChoiceOption(name="mode_conteneur_actif", doc="Redefine description", values=('a', 'b'), default="a", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/51redefine_value/tiramisu/base.py b/tests/dictionaries/51redefine_value/tiramisu/base.py index 580522896..9aee151bd 100644 --- a/tests/dictionaries/51redefine_value/tiramisu/base.py +++ b/tests/dictionaries/51redefine_value/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine value", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="Redefine value", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine value", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine value", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/51redefine_value/tiramisu/multi.py b/tests/dictionaries/51redefine_value/tiramisu/multi.py new file mode 100644 index 000000000..c15e49f60 --- /dev/null +++ b/tests/dictionaries/51redefine_value/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine value", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine value", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="Redefine value", default="non", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="Redefine value", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/51remove_fill/tiramisu/base.py b/tests/dictionaries/51remove_fill/tiramisu/base.py index 05afe6c16..6716dbacc 100644 --- a/tests/dictionaries/51remove_fill/tiramisu/base.py +++ b/tests/dictionaries/51remove_fill/tiramisu/base.py @@ -2,20 +2,24 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4]) diff --git a/tests/dictionaries/51remove_fill/tiramisu/multi.py b/tests/dictionaries/51remove_fill/tiramisu/multi.py new file mode 100644 index 000000000..81f3a5435 --- /dev/null +++ b/tests/dictionaries/51remove_fill/tiramisu/multi.py @@ -0,0 +1,31 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9]) diff --git a/tests/dictionaries/52exists_redefine/tiramisu/base.py b/tests/dictionaries/52exists_redefine/tiramisu/base.py index df2b0323a..4602a66fb 100644 --- a/tests/dictionaries/52exists_redefine/tiramisu/base.py +++ b/tests/dictionaries/52exists_redefine/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="New description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="New description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/52exists_redefine/tiramisu/multi.py b/tests/dictionaries/52exists_redefine/tiramisu/multi.py new file mode 100644 index 000000000..957e1b3bd --- /dev/null +++ b/tests/dictionaries/52exists_redefine/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="New description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="New description", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/60action_external/tiramisu/base.py b/tests/dictionaries/60action_external/tiramisu/base.py index f5c34b884..4ff9eca4d 100644 --- a/tests/dictionaries/60action_external/tiramisu/base.py +++ b/tests/dictionaries/60action_external/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) -option_7 = URLOption(name="calc_url", doc="domain", default=Calculation(func.calc_val, Params((ParamValue("http://localhost/")))), allow_ip=True, allow_without_dot=True, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_7], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="extra", doc="extra", children=[option_5]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_5 = URLOption(name="calc_url", doc="domain", default=Calculation(func.calc_val, Params((ParamValue("http://localhost/")))), allow_ip=True, allow_without_dot=True, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6, optiondescription_7]) diff --git a/tests/dictionaries/60action_external/tiramisu/multi.py b/tests/dictionaries/60action_external/tiramisu/multi.py new file mode 100644 index 000000000..cb9c4641d --- /dev/null +++ b/tests/dictionaries/60action_external/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_5 = URLOption(name="calc_url", doc="domain", default=Calculation(func.calc_val, Params((ParamValue("http://localhost/")))), allow_ip=True, allow_without_dot=True, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4, option_5], properties=frozenset({"normal"})) +optiondescription_13 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12, optiondescription_13]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +option_9 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_10 = URLOption(name="calc_url", doc="domain", default=Calculation(func.calc_val, Params((ParamValue("http://localhost/")))), allow_ip=True, allow_without_dot=True, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"})) +optiondescription_8 = OptionDescription(name="test", doc="test", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="extra", doc="extra", children=[optiondescription_8]) +optiondescription_14 = OptionDescription(name="2", doc="2", children=[optiondescription_15, optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_14]) diff --git a/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py b/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py index b3cf2400e..eabccfbcd 100644 --- a/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py +++ b/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py @@ -2,29 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_5 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) -option_3 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_4 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4, option_5], properties=frozenset({"basic"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) -option_10 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_8, option_9, option_10], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="extra", doc="extra", children=[option_7]) -option_13 = StrOption(name="description", doc="description", default="test", properties=frozenset({"mandatory", "normal"})) -option_12 = OptionDescription(name="external", doc="external", children=[option_13], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_8, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) -option_11 = OptionDescription(name="extra1", doc="extra1", children=[option_12]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6, option_11]) +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_3 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_11 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_8 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="extra", doc="extra", children=[optiondescription_5]) +option_10 = StrOption(name="description", doc="description", default="test", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="external", doc="external", children=[option_10], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_13 = OptionDescription(name="extra1", doc="extra1", children=[optiondescription_9]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/60extra_externalspacecondition/tiramisu/multi.py b/tests/dictionaries/60extra_externalspacecondition/tiramisu/multi.py new file mode 100644 index 000000000..4cc82e569 --- /dev/null +++ b/tests/dictionaries/60extra_externalspacecondition/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_3 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3, option_4], properties=frozenset({"basic"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_8 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_23 = OptionDescription(name="extra", doc="extra", children=[optiondescription_5]) +option_10 = StrOption(name="description", doc="description", default="test", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="external", doc="external", children=[option_10], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_6, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_24 = OptionDescription(name="extra1", doc="extra1", children=[optiondescription_9]) +optiondescription_21 = OptionDescription(name="1", doc="1", children=[optiondescription_22, optiondescription_23, optiondescription_24]) +option_14 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"hidden", "mandatory", "normal"})) +option_12 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_14, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +option_13 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="general", doc="général", children=[option_12, option_13, option_14], properties=frozenset({"basic"})) +optiondescription_26 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_11]) +option_16 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_17 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_18 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_15 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_16, option_17, option_18], properties=frozenset({"normal"})) +optiondescription_27 = OptionDescription(name="extra", doc="extra", children=[optiondescription_15]) +option_20 = StrOption(name="description", doc="description", default="test", properties=frozenset({"mandatory", "normal"})) +optiondescription_19 = OptionDescription(name="external", doc="external", children=[option_20], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_16, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))})) +optiondescription_28 = OptionDescription(name="extra1", doc="extra1", children=[optiondescription_19]) +optiondescription_25 = OptionDescription(name="2", doc="2", children=[optiondescription_26, optiondescription_27, optiondescription_28]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_21, optiondescription_25]) diff --git a/tests/dictionaries/60extra_help/tiramisu/base.py b/tests/dictionaries/60extra_help/tiramisu/base.py index b01d1fb72..82b1527e3 100644 --- a/tests/dictionaries/60extra_help/tiramisu/base.py +++ b/tests/dictionaries/60extra_help/tiramisu/base.py @@ -2,35 +2,40 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_8 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) -option_8.impl_set_information('help', "Test help") -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) -option_13.impl_set_information('source', "mailname") -option_12 = OptionDescription(name="files", doc="files", children=[option_13]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test_service", doc="test.service", children=[option_12, option_16, option_17]) -option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_6.impl_set_information('help', "Test help") +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_13]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_14, optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/60extra_help/tiramisu/multi.py b/tests/dictionaries/60extra_help/tiramisu/multi.py new file mode 100644 index 000000000..53d2b863b --- /dev/null +++ b/tests/dictionaries/60extra_help/tiramisu/multi.py @@ -0,0 +1,63 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_6.impl_set_information('help', "Test help") +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_29 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_31 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_20]) +optiondescription_31.impl_set_information('type', "service") +optiondescription_30 = OptionDescription(name="services", doc="services", children=[optiondescription_31], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="1", doc="1", children=[optiondescription_28, optiondescription_29, optiondescription_30]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_33 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_12 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_13 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_10, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_13.impl_set_information('help', "Test help") +option_14 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +option_25 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_24 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_23 = OptionDescription(name="mailname", doc="mailname", children=[option_25, option_24]) +optiondescription_23.impl_set_information('source', "mailname") +optiondescription_22 = OptionDescription(name="files", doc="files", children=[optiondescription_23]) +option_21 = BoolOption(name="activate", doc="activate", default=True) +option_26 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_22, option_21, option_26]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_32 = OptionDescription(name="2", doc="2", children=[optiondescription_33, optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_27, optiondescription_32]) diff --git a/tests/dictionaries/60extra_leadership/tiramisu/base.py b/tests/dictionaries/60extra_leadership/tiramisu/base.py index 8130eb11f..f34254a91 100644 --- a/tests/dictionaries/60extra_leadership/tiramisu/base.py +++ b/tests/dictionaries/60extra_leadership/tiramisu/base.py @@ -2,39 +2,44 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) -option_9 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = Leadership(name="leadership", doc="description", children=[option_8, option_9], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) -option_13.impl_set_information('source', "mailname") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) -option_16.impl_set_information('engine', "jinja2") -option_16.impl_set_information('source', "mailname2") -option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) -option_19 = BoolOption(name="activate", doc="activate", default=True) -option_20 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test_service", doc="test.service", children=[option_12, option_19, option_20]) -option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="leadership", doc="description", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10, optiondescription_13]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_16]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_18, optiondescription_19]) diff --git a/tests/dictionaries/60extra_leadership/tiramisu/multi.py b/tests/dictionaries/60extra_leadership/tiramisu/multi.py new file mode 100644 index 000000000..4f922d42b --- /dev/null +++ b/tests/dictionaries/60extra_leadership/tiramisu/multi.py @@ -0,0 +1,71 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="leadership", doc="description", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_35 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +option_22 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_21]) +optiondescription_20.impl_set_information('engine', "jinja2") +optiondescription_20.impl_set_information('source', "mailname2") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17, optiondescription_20]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_23 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_37 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_23]) +optiondescription_37.impl_set_information('type', "service") +optiondescription_36 = OptionDescription(name="services", doc="services", children=[optiondescription_37], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="1", doc="1", children=[optiondescription_34, optiondescription_35, optiondescription_36]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_39 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_13 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_14 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = Leadership(name="leadership", doc="description", children=[option_13, option_14], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_40 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +option_28 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_27 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_26 = OptionDescription(name="mailname", doc="mailname", children=[option_28, option_27]) +optiondescription_26.impl_set_information('source', "mailname") +option_31 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="mailname2", doc="mailname2", children=[option_31, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "mailname2") +optiondescription_25 = OptionDescription(name="files", doc="files", children=[optiondescription_26, optiondescription_29]) +option_24 = BoolOption(name="activate", doc="activate", default=True) +option_32 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_25, option_24, option_32]) +optiondescription_42.impl_set_information('type', "service") +optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"})) +optiondescription_38 = OptionDescription(name="2", doc="2", children=[optiondescription_39, optiondescription_40, optiondescription_41]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_33, optiondescription_38]) diff --git a/tests/dictionaries/60extra_leadership_name/tiramisu/base.py b/tests/dictionaries/60extra_leadership_name/tiramisu/base.py index 9263ea99a..f78235002 100644 --- a/tests/dictionaries/60extra_leadership_name/tiramisu/base.py +++ b/tests/dictionaries/60extra_leadership_name/tiramisu/base.py @@ -2,39 +2,44 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) -option_9 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = Leadership(name="new_name", doc="new_name", children=[option_8, option_9], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) -option_13.impl_set_information('source', "mailname") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) -option_16.impl_set_information('engine', "jinja2") -option_16.impl_set_information('source', "mailname2") -option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) -option_19 = BoolOption(name="activate", doc="activate", default=True) -option_20 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test_service", doc="test.service", children=[option_12, option_19, option_20]) -option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="new_name", doc="new_name", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10, optiondescription_13]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_16]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_18, optiondescription_19]) diff --git a/tests/dictionaries/60extra_leadership_name/tiramisu/multi.py b/tests/dictionaries/60extra_leadership_name/tiramisu/multi.py new file mode 100644 index 000000000..70b73899e --- /dev/null +++ b/tests/dictionaries/60extra_leadership_name/tiramisu/multi.py @@ -0,0 +1,71 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="new_name", doc="new_name", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_35 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +option_22 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_21]) +optiondescription_20.impl_set_information('engine', "jinja2") +optiondescription_20.impl_set_information('source', "mailname2") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17, optiondescription_20]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_23 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_37 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_23]) +optiondescription_37.impl_set_information('type', "service") +optiondescription_36 = OptionDescription(name="services", doc="services", children=[optiondescription_37], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="1", doc="1", children=[optiondescription_34, optiondescription_35, optiondescription_36]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_39 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_13 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_14 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = Leadership(name="new_name", doc="new_name", children=[option_13, option_14], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_40 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +option_28 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_27 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_26 = OptionDescription(name="mailname", doc="mailname", children=[option_28, option_27]) +optiondescription_26.impl_set_information('source', "mailname") +option_31 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="mailname2", doc="mailname2", children=[option_31, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "mailname2") +optiondescription_25 = OptionDescription(name="files", doc="files", children=[optiondescription_26, optiondescription_29]) +option_24 = BoolOption(name="activate", doc="activate", default=True) +option_32 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_25, option_24, option_32]) +optiondescription_42.impl_set_information('type', "service") +optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"})) +optiondescription_38 = OptionDescription(name="2", doc="2", children=[optiondescription_39, optiondescription_40, optiondescription_41]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_33, optiondescription_38]) diff --git a/tests/dictionaries/60extra_leadership_name_item/tiramisu/base.py b/tests/dictionaries/60extra_leadership_name_item/tiramisu/base.py index 9263ea99a..f78235002 100644 --- a/tests/dictionaries/60extra_leadership_name_item/tiramisu/base.py +++ b/tests/dictionaries/60extra_leadership_name_item/tiramisu/base.py @@ -2,39 +2,44 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) -option_9 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = Leadership(name="new_name", doc="new_name", children=[option_8, option_9], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) -option_13.impl_set_information('source', "mailname") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) -option_16.impl_set_information('engine', "jinja2") -option_16.impl_set_information('source', "mailname2") -option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) -option_19 = BoolOption(name="activate", doc="activate", default=True) -option_20 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test_service", doc="test.service", children=[option_12, option_19, option_20]) -option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="new_name", doc="new_name", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10, optiondescription_13]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_16]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_18, optiondescription_19]) diff --git a/tests/dictionaries/60extra_leadership_name_item/tiramisu/multi.py b/tests/dictionaries/60extra_leadership_name_item/tiramisu/multi.py new file mode 100644 index 000000000..70b73899e --- /dev/null +++ b/tests/dictionaries/60extra_leadership_name_item/tiramisu/multi.py @@ -0,0 +1,71 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="new_name", doc="new_name", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_35 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +option_22 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_21]) +optiondescription_20.impl_set_information('engine', "jinja2") +optiondescription_20.impl_set_information('source', "mailname2") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17, optiondescription_20]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_23 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_37 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_23]) +optiondescription_37.impl_set_information('type', "service") +optiondescription_36 = OptionDescription(name="services", doc="services", children=[optiondescription_37], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="1", doc="1", children=[optiondescription_34, optiondescription_35, optiondescription_36]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_39 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_13 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_14 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = Leadership(name="new_name", doc="new_name", children=[option_13, option_14], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_40 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +option_28 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_27 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_26 = OptionDescription(name="mailname", doc="mailname", children=[option_28, option_27]) +optiondescription_26.impl_set_information('source', "mailname") +option_31 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="mailname2", doc="mailname2", children=[option_31, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "mailname2") +optiondescription_25 = OptionDescription(name="files", doc="files", children=[optiondescription_26, optiondescription_29]) +option_24 = BoolOption(name="activate", doc="activate", default=True) +option_32 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_25, option_24, option_32]) +optiondescription_42.impl_set_information('type', "service") +optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"})) +optiondescription_38 = OptionDescription(name="2", doc="2", children=[optiondescription_39, optiondescription_40, optiondescription_41]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_33, optiondescription_38]) diff --git a/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/base.py b/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/base.py index bc7824441..c17c10676 100644 --- a/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/base.py +++ b/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/base.py @@ -2,39 +2,44 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = Leadership(name="description", doc="description", children=[option_8, option_9], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) -option_13.impl_set_information('source', "mailname") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) -option_16.impl_set_information('engine', "jinja2") -option_16.impl_set_information('source', "mailname2") -option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) -option_19 = BoolOption(name="activate", doc="activate", default=True) -option_20 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test_service", doc="test.service", children=[option_12, option_19, option_20]) -option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="description", doc="description", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname", doc="mailname", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_9 = OptionDescription(name="files", doc="files", children=[optiondescription_10, optiondescription_13]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_9, option_8, option_16]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_18, optiondescription_19]) diff --git a/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/multi.py b/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/multi.py new file mode 100644 index 000000000..ef3ee9357 --- /dev/null +++ b/tests/dictionaries/60extra_leadership_valid_enum/tiramisu/multi.py @@ -0,0 +1,71 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = Leadership(name="description", doc="description", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_5], properties=frozenset({"normal"})) +optiondescription_35 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_19 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_18 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_17 = OptionDescription(name="mailname", doc="mailname", children=[option_19, option_18]) +optiondescription_17.impl_set_information('source', "mailname") +option_22 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_21]) +optiondescription_20.impl_set_information('engine', "jinja2") +optiondescription_20.impl_set_information('source', "mailname2") +optiondescription_16 = OptionDescription(name="files", doc="files", children=[optiondescription_17, optiondescription_20]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_23 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_37 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_16, option_15, option_23]) +optiondescription_37.impl_set_information('type', "service") +optiondescription_36 = OptionDescription(name="services", doc="services", children=[optiondescription_37], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="1", doc="1", children=[optiondescription_34, optiondescription_35, optiondescription_36]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_39 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_13 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_14 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = Leadership(name="description", doc="description", children=[option_13, option_14], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[optiondescription_12], properties=frozenset({"normal"})) +optiondescription_40 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +option_28 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_27 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_26 = OptionDescription(name="mailname", doc="mailname", children=[option_28, option_27]) +optiondescription_26.impl_set_information('source', "mailname") +option_31 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_30 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_29 = OptionDescription(name="mailname2", doc="mailname2", children=[option_31, option_30]) +optiondescription_29.impl_set_information('engine', "jinja2") +optiondescription_29.impl_set_information('source', "mailname2") +optiondescription_25 = OptionDescription(name="files", doc="files", children=[optiondescription_26, optiondescription_29]) +option_24 = BoolOption(name="activate", doc="activate", default=True) +option_32 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_25, option_24, option_32]) +optiondescription_42.impl_set_information('type', "service") +optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"})) +optiondescription_38 = OptionDescription(name="2", doc="2", children=[optiondescription_39, optiondescription_40, optiondescription_41]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_33, optiondescription_38]) diff --git a/tests/dictionaries/60extra_load/tiramisu/base.py b/tests/dictionaries/60extra_load/tiramisu/base.py index 37c3655d2..24702a8d3 100644 --- a/tests/dictionaries/60extra_load/tiramisu/base.py +++ b/tests/dictionaries/60extra_load/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_8 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/60extra_load/tiramisu/multi.py b/tests/dictionaries/60extra_load/tiramisu/multi.py new file mode 100644 index 000000000..705368a39 --- /dev/null +++ b/tests/dictionaries/60extra_load/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_19 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_12 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_13 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_10, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_14 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +optiondescription_18 = OptionDescription(name="2", doc="2", children=[optiondescription_19, optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_18]) diff --git a/tests/dictionaries/60extra_mandatory/tiramisu/base.py b/tests/dictionaries/60extra_mandatory/tiramisu/base.py index 8035b5f6f..5c491f497 100644 --- a/tests/dictionaries/60extra_mandatory/tiramisu/base.py +++ b/tests/dictionaries/60extra_mandatory/tiramisu/base.py @@ -2,26 +2,30 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_8 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_10 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9, option_10], properties=frozenset({"basic"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7, option_8], properties=frozenset({"basic"})) +optiondescription_10 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/60extra_mandatory/tiramisu/multi.py b/tests/dictionaries/60extra_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..b889018e0 --- /dev/null +++ b/tests/dictionaries/60extra_mandatory/tiramisu/multi.py @@ -0,0 +1,43 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7, option_8], properties=frozenset({"basic"})) +optiondescription_19 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_10 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_11 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="général", children=[option_10, option_11], properties=frozenset({"normal"})) +optiondescription_21 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9]) +option_13 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_14 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_11, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_15 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +option_16 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"})) +optiondescription_12 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_13, option_14, option_15, option_16], properties=frozenset({"basic"})) +optiondescription_22 = OptionDescription(name="extra", doc="extra", children=[optiondescription_12]) +optiondescription_20 = OptionDescription(name="2", doc="2", children=[optiondescription_21, optiondescription_22]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_20]) diff --git a/tests/dictionaries/60extra_name_family/tiramisu/base.py b/tests/dictionaries/60extra_name_family/tiramisu/base.py index 6c111c91b..be37d49fb 100644 --- a/tests/dictionaries/60extra_name_family/tiramisu/base.py +++ b/tests/dictionaries/60extra_name_family/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="extra", doc="extra", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_8 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="extra", doc="extra", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/60extra_name_family/tiramisu/multi.py b/tests/dictionaries/60extra_name_family/tiramisu/multi.py new file mode 100644 index 000000000..421ff7ae4 --- /dev/null +++ b/tests/dictionaries/60extra_name_family/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="extra", doc="extra", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="extra", doc="extra", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_19 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_12 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_13 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_10, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_14 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +optiondescription_18 = OptionDescription(name="2", doc="2", children=[optiondescription_19, optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_18]) diff --git a/tests/dictionaries/60extra_no_condition/tiramisu/base.py b/tests/dictionaries/60extra_no_condition/tiramisu/base.py index f98d48dad..60fccbda1 100644 --- a/tests/dictionaries/60extra_no_condition/tiramisu/base.py +++ b/tests/dictionaries/60extra_no_condition/tiramisu/base.py @@ -2,26 +2,30 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_5 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) -option_10 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_7 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_8, option_9, option_10], properties=frozenset({"normal"})) -option_6 = OptionDescription(name="extra", doc="extra", children=[option_7]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_8 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="extra", doc="extra", children=[optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/60extra_no_condition/tiramisu/multi.py b/tests/dictionaries/60extra_no_condition/tiramisu/multi.py new file mode 100644 index 000000000..e234df75e --- /dev/null +++ b/tests/dictionaries/60extra_no_condition/tiramisu/multi.py @@ -0,0 +1,43 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3, option_4], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_6 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_8 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) +optiondescription_19 = OptionDescription(name="extra", doc="extra", children=[optiondescription_5]) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_10 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) +option_11 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_12 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="général", children=[option_10, option_11, option_12], properties=frozenset({"normal"})) +optiondescription_21 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_9]) +option_14 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) +option_15 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) +option_16 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_13 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_14, option_15, option_16], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="extra", doc="extra", children=[optiondescription_13]) +optiondescription_20 = OptionDescription(name="2", doc="2", children=[optiondescription_21, optiondescription_22]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_20]) diff --git a/tests/dictionaries/60extra_redefine/tiramisu/base.py b/tests/dictionaries/60extra_redefine/tiramisu/base.py index 165098921..d0d1d9290 100644 --- a/tests/dictionaries/60extra_redefine/tiramisu/base.py +++ b/tests/dictionaries/60extra_redefine/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_8 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) -option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/60extra_redefine/tiramisu/multi.py b/tests/dictionaries/60extra_redefine/tiramisu/multi.py new file mode 100644 index 000000000..b0200ea87 --- /dev/null +++ b/tests/dictionaries/60extra_redefine/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_3, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_7 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5, option_6, option_7], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_9 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_10 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="general", doc="général", children=[option_9, option_10], properties=frozenset({"normal"})) +optiondescription_19 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_8]) +option_12 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_13 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default=Calculation(func.calc_multi_condition, Params((ParamValue("non")), kwargs={'condition_1': ParamOption(option_10, notraisepropertyerror=True), 'match': ParamValue("none"), 'mismatch': ParamValue("daily")})), properties=frozenset({"mandatory", "normal"})) +option_14 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) +optiondescription_11 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_12, option_13, option_14], properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="extra", doc="extra", children=[optiondescription_11]) +optiondescription_18 = OptionDescription(name="2", doc="2", children=[optiondescription_19, optiondescription_20]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_18]) diff --git a/tests/dictionaries/60extra_variable_name_extra/tiramisu/base.py b/tests/dictionaries/60extra_variable_name_extra/tiramisu/base.py index 63ee492c5..ed602ff13 100644 --- a/tests/dictionaries/60extra_variable_name_extra/tiramisu/base.py +++ b/tests/dictionaries/60extra_variable_name_extra/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = StrOption(name="extra", doc="extra", properties=frozenset({"normal"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="extra", doc="extra", properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="extra", doc="extra", children=[option_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/60extra_variable_name_extra/tiramisu/multi.py b/tests/dictionaries/60extra_variable_name_extra/tiramisu/multi.py new file mode 100644 index 000000000..05610394b --- /dev/null +++ b/tests/dictionaries/60extra_variable_name_extra/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="extra", doc="extra", properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="extra", doc="extra", children=[option_4]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_7 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6, option_7], properties=frozenset({"normal"})) +optiondescription_13 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_8 = StrOption(name="extra", doc="extra", properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="extra", doc="extra", children=[option_8]) +optiondescription_12 = OptionDescription(name="2", doc="2", children=[optiondescription_13, optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_12]) diff --git a/tests/dictionaries/60familyaction/tiramisu/base.py b/tests/dictionaries/60familyaction/tiramisu/base.py index bef41e050..2dc75f001 100644 --- a/tests/dictionaries/60familyaction/tiramisu/base.py +++ b/tests/dictionaries/60familyaction/tiramisu/base.py @@ -2,22 +2,26 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) -option_5 = OptionDescription(name="test", doc="test", children=[option_6], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="extra", doc="extra", children=[option_5]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/60familyaction/tiramisu/multi.py b/tests/dictionaries/60familyaction/tiramisu/multi.py new file mode 100644 index 000000000..d8dc6b90d --- /dev/null +++ b/tests/dictionaries/60familyaction/tiramisu/multi.py @@ -0,0 +1,35 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"normal"})) +optiondescription_13 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_8 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="test", doc="test", children=[option_8], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="extra", doc="extra", children=[optiondescription_7]) +optiondescription_12 = OptionDescription(name="2", doc="2", children=[optiondescription_13, optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_12]) diff --git a/tests/dictionaries/60familyaction_mandatory/tiramisu/base.py b/tests/dictionaries/60familyaction_mandatory/tiramisu/base.py index 2cc0830ac..865653c4e 100644 --- a/tests/dictionaries/60familyaction_mandatory/tiramisu/base.py +++ b/tests/dictionaries/60familyaction_mandatory/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) -option_7 = IntOption(name="day", doc="day avant lancement", properties=frozenset({"basic", "mandatory"})) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_7], properties=frozenset({"basic"})) -option_4 = OptionDescription(name="extra", doc="extra", children=[option_5]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_5 = IntOption(name="day", doc="day avant lancement", properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4, option_5], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6, optiondescription_7]) diff --git a/tests/dictionaries/60familyaction_mandatory/tiramisu/multi.py b/tests/dictionaries/60familyaction_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..aaffba6c6 --- /dev/null +++ b/tests/dictionaries/60familyaction_mandatory/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_5 = IntOption(name="day", doc="day avant lancement", properties=frozenset({"basic", "mandatory"})) +optiondescription_3 = OptionDescription(name="test", doc="test", children=[option_4, option_5], properties=frozenset({"basic"})) +optiondescription_13 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12, optiondescription_13]) +option_7 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +option_9 = IntOption(name="delay", doc="délai en minutes avant lancement", default=0, properties=frozenset({"mandatory", "normal"})) +option_10 = IntOption(name="day", doc="day avant lancement", properties=frozenset({"basic", "mandatory"})) +optiondescription_8 = OptionDescription(name="test", doc="test", children=[option_9, option_10], properties=frozenset({"basic"})) +optiondescription_16 = OptionDescription(name="extra", doc="extra", children=[optiondescription_8]) +optiondescription_14 = OptionDescription(name="2", doc="2", children=[optiondescription_15, optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_14]) diff --git a/tests/dictionaries/61extra_auto_freeze/tiramisu/base.py b/tests/dictionaries/61extra_auto_freeze/tiramisu/base.py index d38b841b0..9523aa65b 100644 --- a/tests/dictionaries/61extra_auto_freeze/tiramisu/base.py +++ b/tests/dictionaries/61extra_auto_freeze/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = BoolOption(name="server_deployed", doc="No change", default=True, properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = StrOption(name="mode", doc="mode", default="pre", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) -option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"basic"})) -option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = BoolOption(name="server_deployed", doc="No change", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="mode", doc="mode", default="pre", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5], properties=frozenset({"basic"})) +optiondescription_7 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6, optiondescription_7]) diff --git a/tests/dictionaries/61extra_auto_freeze/tiramisu/multi.py b/tests/dictionaries/61extra_auto_freeze/tiramisu/multi.py new file mode 100644 index 000000000..38245a304 --- /dev/null +++ b/tests/dictionaries/61extra_auto_freeze/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = BoolOption(name="server_deployed", doc="No change", default=True, properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = StrOption(name="mode", doc="mode", default="pre", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_4 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_5], properties=frozenset({"basic"})) +optiondescription_13 = OptionDescription(name="extra", doc="extra", children=[optiondescription_4]) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12, optiondescription_13]) +option_7 = BoolOption(name="server_deployed", doc="No change", default=True, properties=frozenset({"mandatory", "normal"})) +option_8 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_6 = OptionDescription(name="general", doc="général", children=[option_7, option_8], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_6]) +option_10 = StrOption(name="mode", doc="mode", default="pre", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))})) +optiondescription_9 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_10], properties=frozenset({"basic"})) +optiondescription_16 = OptionDescription(name="extra", doc="extra", children=[optiondescription_9]) +optiondescription_14 = OptionDescription(name="2", doc="2", children=[optiondescription_15, optiondescription_16]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_14]) diff --git a/tests/dictionaries/61extra_dyn/tiramisu/base.py b/tests/dictionaries/61extra_dyn/tiramisu/base.py index 4defe9019..8105adffe 100644 --- a/tests/dictionaries/61extra_dyn/tiramisu/base.py +++ b/tests/dictionaries/61extra_dyn/tiramisu/base.py @@ -2,23 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) -option_5 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="extra", doc="extra", children=[option_5]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/61extra_dyn/tiramisu/multi.py b/tests/dictionaries/61extra_dyn/tiramisu/multi.py new file mode 100644 index 000000000..1097fd51f --- /dev/null +++ b/tests/dictionaries/61extra_dyn/tiramisu/multi.py @@ -0,0 +1,36 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_3 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_2, notraisepropertyerror=True)))), children=[option_4], properties=frozenset({"normal"})) +optiondescription_11 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3]) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_6 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"normal"})) +optiondescription_13 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_8 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_7 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="extra", doc="extra", children=[optiondescription_7]) +optiondescription_12 = OptionDescription(name="2", doc="2", children=[optiondescription_13, optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_12]) diff --git a/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py b/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py index e452ef282..1174072f9 100644 --- a/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py +++ b/tests/dictionaries/61extra_dyn_extra/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription -option_3 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) -option_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"normal"})) -option_8 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) -option_7 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"})) -option_4 = OptionDescription(name="extra", doc="extra", children=[option_5, option_7]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_5 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3, optiondescription_5]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_8]) diff --git a/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py b/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py new file mode 100644 index 000000000..95085578d --- /dev/null +++ b/tests/dictionaries/61extra_dyn_extra/tiramisu/multi.py @@ -0,0 +1,40 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +option_2 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +option_6 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_5 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_4, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="extra", doc="extra", children=[optiondescription_3, optiondescription_5]) +optiondescription_13 = OptionDescription(name="1", doc="1", children=[optiondescription_14, optiondescription_15]) +option_8 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_7 = OptionDescription(name="general", doc="général", children=[option_8], properties=frozenset({"normal"})) +optiondescription_17 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_7]) +option_10 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="general", doc="général", children=[option_10], properties=frozenset({"normal"})) +option_12 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"})) +optiondescription_11 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_10, notraisepropertyerror=True)))), children=[option_12], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="extra", doc="extra", children=[optiondescription_9, optiondescription_11]) +optiondescription_16 = OptionDescription(name="2", doc="2", children=[optiondescription_17, optiondescription_18]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_13, optiondescription_16]) diff --git a/tests/dictionaries/70container_files/tiramisu/base.py b/tests/dictionaries/70container_files/tiramisu/base.py index 36a04b6cf..15e94da03 100644 --- a/tests/dictionaries/70container_files/tiramisu/base.py +++ b/tests/dictionaries/70container_files/tiramisu/base.py @@ -2,32 +2,37 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname", doc="mailname", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "mailname") +option_10 = FilenameOption(name="name", doc="name", default="/rougail.conf") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) -option_7.impl_set_information('source', "mailname") -option_11 = FilenameOption(name="name", doc="name", default="/rougail.conf") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_11, option_12]) -option_10.impl_set_information('source', "rougail.conf") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_10, option_9]) +optiondescription_8.impl_set_information('source', "rougail.conf") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/70container_files/tiramisu/multi.py b/tests/dictionaries/70container_files/tiramisu/multi.py new file mode 100644 index 000000000..96a5e9cfe --- /dev/null +++ b/tests/dictionaries/70container_files/tiramisu/multi.py @@ -0,0 +1,57 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "mailname") +option_12 = FilenameOption(name="name", doc="name", default="/rougail.conf") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "rougail.conf") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="mailname", doc="mailname", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "mailname") +option_21 = FilenameOption(name="name", doc="name", default="/rougail.conf") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "rougail.conf") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py index 822664622..0734b281a 100644 --- a/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py @@ -2,33 +2,38 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) -option_3 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_2) +option_1 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname", doc="mailname", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "mailname") +option_10 = SymLinkOption(name="name", opt=option_2) option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) -option_7.impl_set_information('source', "mailname") -option_11 = SymLinkOption(name="name", opt=option_3) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_11, option_12]) -option_10.impl_set_information('engine', "jinja2") -option_10.impl_set_information('source', "mailname2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="mailname2", doc="mailname2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('engine', "jinja2") +optiondescription_8.impl_set_information('source', "mailname2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/70container_files_symlink_multi/tiramisu/multi.py b/tests/dictionaries/70container_files_symlink_multi/tiramisu/multi.py new file mode 100644 index 000000000..7c8f248c2 --- /dev/null +++ b/tests/dictionaries/70container_files_symlink_multi/tiramisu/multi.py @@ -0,0 +1,59 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_1) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "mailname") +option_12 = SymLinkOption(name="name", opt=option_2) +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "mailname2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_3 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_4 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_18 = SymLinkOption(name="name", opt=option_3) +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="mailname", doc="mailname", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "mailname") +option_21 = SymLinkOption(name="name", opt=option_4) +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="mailname2", doc="mailname2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('engine', "jinja2") +optiondescription_19.impl_set_information('source', "mailname2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py index c505d8c95..99bae373b 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py @@ -2,36 +2,41 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) -option_3 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) -option_4 = StrOption(name="var", doc="var", multi=True, default=['mailname', 'mailname2'], default_multi="mailname", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3, option_4]) -option_9 = SymLinkOption(name="name", opt=option_2) -option_10 = SymLinkOption(name="variable", opt=option_4) +option_1 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="var", doc="var", multi=True, default=['mailname', 'mailname2'], default_multi="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +option_8 = SymLinkOption(name="name", opt=option_1) +option_9 = SymLinkOption(name="variable", opt=option_3) +option_7 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_6 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_7]) +optiondescription_6.impl_set_information('source', "mailname") +option_12 = SymLinkOption(name="name", opt=option_2) +option_13 = SymLinkOption(name="variable", opt=option_3) option_11 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_10, option_11]) -option_8.impl_set_information('source', "mailname") -option_13 = SymLinkOption(name="name", opt=option_3) -option_14 = SymLinkOption(name="variable", opt=option_4) -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="mailname2", doc="mailname2", children=[option_13, option_14, option_15]) -option_12.impl_set_information('engine', "jinja2") -option_12.impl_set_information('source', "mailname2") -option_7 = OptionDescription(name="files", doc="files", children=[option_8, option_12]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_16, option_17]) -option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +optiondescription_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_12, option_13, option_11]) +optiondescription_10.impl_set_information('engine', "jinja2") +optiondescription_10.impl_set_information('source', "mailname2") +optiondescription_5 = OptionDescription(name="files", doc="files", children=[optiondescription_6, optiondescription_10]) +option_4 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_5, option_4, option_14]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/multi.py b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/multi.py new file mode 100644 index 000000000..e91abfd45 --- /dev/null +++ b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/multi.py @@ -0,0 +1,65 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="var", doc="var", multi=True, default=['mailname', 'mailname2'], default_multi="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2, option_3]) +option_11 = SymLinkOption(name="name", opt=option_1) +option_12 = SymLinkOption(name="variable", opt=option_3) +option_10 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_9 = OptionDescription(name="mailname", doc="mailname", children=[option_11, option_12, option_10]) +optiondescription_9.impl_set_information('source', "mailname") +option_15 = SymLinkOption(name="name", opt=option_2) +option_16 = SymLinkOption(name="variable", opt=option_3) +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname2", doc="mailname2", children=[option_15, option_16, option_14]) +optiondescription_13.impl_set_information('engine', "jinja2") +optiondescription_13.impl_set_information('source', "mailname2") +optiondescription_8 = OptionDescription(name="files", doc="files", children=[optiondescription_9, optiondescription_13]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_8, option_7, option_17]) +optiondescription_32.impl_set_information('type', "service") +optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"})) +optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31]) +option_4 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_5 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) +option_6 = StrOption(name="var", doc="var", multi=True, default=['mailname', 'mailname2'], default_multi="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, option_5, option_6]) +option_22 = SymLinkOption(name="name", opt=option_4) +option_23 = SymLinkOption(name="variable", opt=option_6) +option_21 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_20 = OptionDescription(name="mailname", doc="mailname", children=[option_22, option_23, option_21]) +optiondescription_20.impl_set_information('source', "mailname") +option_26 = SymLinkOption(name="name", opt=option_5) +option_27 = SymLinkOption(name="variable", opt=option_6) +option_25 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_24 = OptionDescription(name="mailname2", doc="mailname2", children=[option_26, option_27, option_25]) +optiondescription_24.impl_set_information('engine', "jinja2") +optiondescription_24.impl_set_information('source', "mailname2") +optiondescription_19 = OptionDescription(name="files", doc="files", children=[optiondescription_20, optiondescription_24]) +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_28 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_19, option_18, option_28]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33]) diff --git a/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py index b84b7b5d9..4f4e45fe6 100644 --- a/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py @@ -2,29 +2,34 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = FilenameOption(name="file_name", doc="file_name", default="/etc/mailname", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_2) -option_9 = SymLinkOption(name="variable", opt=option_3) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10]) -option_7.impl_set_information('source', "mailname") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_12 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_11, option_12]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = FilenameOption(name="file_name", doc="file_name", default="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_8 = SymLinkOption(name="variable", opt=option_2) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname", doc="mailname", children=[option_7, option_8, option_6]) +optiondescription_5.impl_set_information('source', "mailname") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_9]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_10, optiondescription_11]) diff --git a/tests/dictionaries/70container_files_symlink_variable/tiramisu/multi.py b/tests/dictionaries/70container_files_symlink_variable/tiramisu/multi.py new file mode 100644 index 000000000..49a504aca --- /dev/null +++ b/tests/dictionaries/70container_files_symlink_variable/tiramisu/multi.py @@ -0,0 +1,51 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = FilenameOption(name="file_name", doc="file_name", default="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_1) +option_10 = SymLinkOption(name="variable", opt=option_2) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_10, option_8]) +optiondescription_7.impl_set_information('source', "mailname") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_11]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="1", doc="1", children=[optiondescription_20, optiondescription_21]) +option_3 = FilenameOption(name="file_name", doc="file_name", default="/etc/mailname", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_16 = SymLinkOption(name="name", opt=option_3) +option_17 = SymLinkOption(name="variable", opt=option_4) +option_15 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_14 = OptionDescription(name="mailname", doc="mailname", children=[option_16, option_17, option_15]) +optiondescription_14.impl_set_information('source', "mailname") +optiondescription_13 = OptionDescription(name="files", doc="files", children=[optiondescription_14]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_18 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_13, option_12, option_18]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="2", doc="2", children=[optiondescription_24, optiondescription_25]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_19, optiondescription_23]) diff --git a/tests/dictionaries/70container_files_twice/tiramisu/base.py b/tests/dictionaries/70container_files_twice/tiramisu/base.py index b16e49610..d8fb539ef 100644 --- a/tests/dictionaries/70container_files_twice/tiramisu/base.py +++ b/tests/dictionaries/70container_files_twice/tiramisu/base.py @@ -2,36 +2,41 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname", doc="mailname", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "mailname") +option_10 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) -option_7.impl_set_information('source', "mailname") -option_11 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") +optiondescription_8 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_10, option_9]) +optiondescription_8.impl_set_information('source', "mailname") +option_13 = FilenameOption(name="name", doc="name", default="/rougail.conf") option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_11, option_12]) -option_10.impl_set_information('source', "mailname") -option_14 = FilenameOption(name="name", doc="name", default="/rougail.conf") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_14, option_15]) -option_13.impl_set_information('source', "rougail.conf") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_11 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "rougail.conf") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14]) +optiondescription_17.impl_set_information('type', "service") +optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16]) diff --git a/tests/dictionaries/70container_files_twice/tiramisu/multi.py b/tests/dictionaries/70container_files_twice/tiramisu/multi.py new file mode 100644 index 000000000..cb21a1d30 --- /dev/null +++ b/tests/dictionaries/70container_files_twice/tiramisu/multi.py @@ -0,0 +1,65 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "mailname") +option_12 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname") +option_15 = FilenameOption(name="name", doc="name", default="/rougail.conf") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "rougail.conf") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16]) +optiondescription_32.impl_set_information('type', "service") +optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"})) +optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_21 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="mailname", doc="mailname", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "mailname") +option_24 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") +option_23 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_22 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_24, option_23]) +optiondescription_22.impl_set_information('source', "mailname") +option_27 = FilenameOption(name="name", doc="name", default="/rougail.conf") +option_26 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_25 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_27, option_26]) +optiondescription_25.impl_set_information('source', "rougail.conf") +optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25]) +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_28 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28]) +optiondescription_36.impl_set_information('type', "service") +optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"})) +optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33]) diff --git a/tests/dictionaries/70container_filesmulti/tiramisu/base.py b/tests/dictionaries/70container_filesmulti/tiramisu/base.py index 95a7e16df..c25e75d50 100644 --- a/tests/dictionaries/70container_filesmulti/tiramisu/base.py +++ b/tests/dictionaries/70container_filesmulti/tiramisu/base.py @@ -2,32 +2,37 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname", doc="mailname", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "mailname") +option_10 = FilenameOption(name="name", doc="name", default="/etc/mailname2") option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) -option_7.impl_set_information('source', "mailname") -option_11 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_11, option_12]) -option_10.impl_set_information('source', "mailname2") -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="mailname2", doc="mailname2", children=[option_10, option_9]) +optiondescription_8.impl_set_information('source', "mailname2") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/70container_filesmulti/tiramisu/multi.py b/tests/dictionaries/70container_filesmulti/tiramisu/multi.py new file mode 100644 index 000000000..b248dd14a --- /dev/null +++ b/tests/dictionaries/70container_filesmulti/tiramisu/multi.py @@ -0,0 +1,57 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "mailname") +option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_12, option_11]) +optiondescription_10.impl_set_information('source', "mailname2") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_18 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="mailname", doc="mailname", children=[option_18, option_17]) +optiondescription_16.impl_set_information('source', "mailname") +option_21 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="mailname2", doc="mailname2", children=[option_21, option_20]) +optiondescription_19.impl_set_information('source', "mailname2") +optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/70container_filesredefine/tiramisu/base.py b/tests/dictionaries/70container_filesredefine/tiramisu/base.py index ef9cf5717..caf7c8f2e 100644 --- a/tests/dictionaries/70container_filesredefine/tiramisu/base.py +++ b/tests/dictionaries/70container_filesredefine/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_8, option_9]) -option_7.impl_set_information('source', "mailname.new") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "mailname.new") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/70container_filesredefine/tiramisu/multi.py b/tests/dictionaries/70container_filesredefine/tiramisu/multi.py new file mode 100644 index 000000000..ce6a83316 --- /dev/null +++ b/tests/dictionaries/70container_filesredefine/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "mailname.new") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_15 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "mailname.new") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/70container_new/tiramisu/base.py b/tests/dictionaries/70container_new/tiramisu/base.py index aa0711707..415f64eb6 100644 --- a/tests/dictionaries/70container_new/tiramisu/base.py +++ b/tests/dictionaries/70container_new/tiramisu/base.py @@ -2,23 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_7]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70container_new/tiramisu/multi.py b/tests/dictionaries/70container_new/tiramisu/multi.py new file mode 100644 index 000000000..baa8d4f23 --- /dev/null +++ b/tests/dictionaries/70container_new/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70container_newnocont/tiramisu/base.py b/tests/dictionaries/70container_newnocont/tiramisu/base.py index 95f72fcf8..c9397222c 100644 --- a/tests/dictionaries/70container_newnocont/tiramisu/base.py +++ b/tests/dictionaries/70container_newnocont/tiramisu/base.py @@ -2,23 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_7]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70container_newnocont/tiramisu/multi.py b/tests/dictionaries/70container_newnocont/tiramisu/multi.py new file mode 100644 index 000000000..fb7059069 --- /dev/null +++ b/tests/dictionaries/70container_newnocont/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70container_newwithip/tiramisu/base.py b/tests/dictionaries/70container_newwithip/tiramisu/base.py index 02c98a0fa..14c6e18b9 100644 --- a/tests/dictionaries/70container_newwithip/tiramisu/base.py +++ b/tests/dictionaries/70container_newwithip/tiramisu/base.py @@ -2,24 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_4 = IPOption(name="adresse_ip_test", doc="No change", allow_reserved=True, properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = BoolOption(name="activate", doc="activate", default=True) -option_8 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_8]) -option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_test", doc="No change", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_4 = BoolOption(name="activate", doc="activate", default=True) +option_5 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_8 = OptionDescription(name="test_service", doc="test.service", children=[option_4, option_5]) +optiondescription_8.impl_set_information('type', "service") +optiondescription_7 = OptionDescription(name="services", doc="services", children=[optiondescription_8], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_6, optiondescription_7]) diff --git a/tests/dictionaries/70container_newwithip/tiramisu/multi.py b/tests/dictionaries/70container_newwithip/tiramisu/multi.py new file mode 100644 index 000000000..76e7e8c57 --- /dev/null +++ b/tests/dictionaries/70container_newwithip/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_3 = IPOption(name="adresse_ip_test", doc="No change", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_8]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="1", doc="1", children=[optiondescription_12, optiondescription_13]) +option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_6 = IPOption(name="adresse_ip_test", doc="No change", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_4 = OptionDescription(name="general", doc="général", children=[option_5, option_6], properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[option_9, option_10]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="2", doc="2", children=[optiondescription_16, optiondescription_17]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_11, optiondescription_15]) diff --git a/tests/dictionaries/70container_save/tiramisu/base.py b/tests/dictionaries/70container_save/tiramisu/base.py index 5fc27f81d..43f9c7f37 100644 --- a/tests/dictionaries/70container_save/tiramisu/base.py +++ b/tests/dictionaries/70container_save/tiramisu/base.py @@ -2,19 +2,23 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3]) diff --git a/tests/dictionaries/70container_save/tiramisu/multi.py b/tests/dictionaries/70container_save/tiramisu/multi.py new file mode 100644 index 000000000..638266c2b --- /dev/null +++ b/tests/dictionaries/70container_save/tiramisu/multi.py @@ -0,0 +1,29 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7]) diff --git a/tests/dictionaries/70service_base/tiramisu/base.py b/tests/dictionaries/70service_base/tiramisu/base.py index dcfc2d7bb..f386b6ce4 100644 --- a/tests/dictionaries/70service_base/tiramisu/base.py +++ b/tests/dictionaries/70service_base/tiramisu/base.py @@ -2,23 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_6, option_7]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_base/tiramisu/multi.py b/tests/dictionaries/70service_base/tiramisu/multi.py new file mode 100644 index 000000000..5d2543ef4 --- /dev/null +++ b/tests/dictionaries/70service_base/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_disabled/tiramisu/base.py b/tests/dictionaries/70service_disabled/tiramisu/base.py index 9c99c7be6..cc6206853 100644 --- a/tests/dictionaries/70service_disabled/tiramisu/base.py +++ b/tests/dictionaries/70service_disabled/tiramisu/base.py @@ -2,22 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=False) -option_6 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = BoolOption(name="activate", doc="activate", default=False) +option_3 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="test_service", doc="test.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('type', "service") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/70service_disabled/tiramisu/multi.py b/tests/dictionaries/70service_disabled/tiramisu/multi.py new file mode 100644 index 000000000..5946ab819 --- /dev/null +++ b/tests/dictionaries/70service_disabled/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = BoolOption(name="activate", doc="activate", default=False) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=False) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/70service_disabled_undisable/tiramisu/base.py b/tests/dictionaries/70service_disabled_undisable/tiramisu/base.py index 78dbf1450..6ae35febf 100644 --- a/tests/dictionaries/70service_disabled_undisable/tiramisu/base.py +++ b/tests/dictionaries/70service_disabled_undisable/tiramisu/base.py @@ -2,23 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=False) -option_6 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) -option_4.impl_set_information('undisable', True) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = BoolOption(name="activate", doc="activate", default=False) +option_3 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="test_service", doc="test.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('undisable', True) +optiondescription_6.impl_set_information('type', "service") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/70service_disabled_undisable/tiramisu/multi.py b/tests/dictionaries/70service_disabled_undisable/tiramisu/multi.py new file mode 100644 index 000000000..63b4c4f78 --- /dev/null +++ b/tests/dictionaries/70service_disabled_undisable/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = BoolOption(name="activate", doc="activate", default=False) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('undisable', True) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=False) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('undisable', True) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/70service_engine/tiramisu/base.py b/tests/dictionaries/70service_engine/tiramisu/base.py index 4cae2d91e..bc6295a63 100644 --- a/tests/dictionaries/70service_engine/tiramisu/base.py +++ b/tests/dictionaries/70service_engine/tiramisu/base.py @@ -2,24 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_6, option_7]) -option_5.impl_set_information('engine', "creole") -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('engine', "creole") +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_engine/tiramisu/multi.py b/tests/dictionaries/70service_engine/tiramisu/multi.py new file mode 100644 index 000000000..1cba7a915 --- /dev/null +++ b/tests/dictionaries/70service_engine/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('engine', "creole") +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('engine', "creole") +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_engine_dash/tiramisu/base.py b/tests/dictionaries/70service_engine_dash/tiramisu/base.py index f21e0957b..cc517f073 100644 --- a/tests/dictionaries/70service_engine_dash/tiramisu/base.py +++ b/tests/dictionaries/70service_engine_dash/tiramisu/base.py @@ -2,24 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_srv_service", doc="test-srv.service", children=[option_6, option_7]) -option_5.impl_set_information('engine', "creole") -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="test_srv_service", doc="test-srv.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('engine', "creole") +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_engine_dash/tiramisu/multi.py b/tests/dictionaries/70service_engine_dash/tiramisu/multi.py new file mode 100644 index 000000000..281e30116 --- /dev/null +++ b/tests/dictionaries/70service_engine_dash/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_srv_service", doc="test-srv.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('engine', "creole") +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_srv_service", doc="test-srv.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('engine', "creole") +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_mount/tiramisu/base.py b/tests/dictionaries/70service_mount/tiramisu/base.py index ecd5dc491..ad401a829 100644 --- a/tests/dictionaries/70service_mount/tiramisu/base.py +++ b/tests/dictionaries/70service_mount/tiramisu/base.py @@ -2,25 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_mount", doc="testsrv.mount", children=[option_6, option_7]) -option_5.impl_set_information('type', "mount") -option_5.impl_set_information('engine', "creole") -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="testsrv_mount", doc="testsrv.mount", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "mount") +optiondescription_7.impl_set_information('engine', "creole") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_mount/tiramisu/multi.py b/tests/dictionaries/70service_mount/tiramisu/multi.py new file mode 100644 index 000000000..65ffbe5ff --- /dev/null +++ b/tests/dictionaries/70service_mount/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_mount", doc="testsrv.mount", children=[option_5, option_6]) +optiondescription_12.impl_set_information('type', "mount") +optiondescription_12.impl_set_information('engine', "creole") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_mount", doc="testsrv.mount", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "mount") +optiondescription_16.impl_set_information('engine', "creole") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_not_managed/tiramisu/base.py b/tests/dictionaries/70service_not_managed/tiramisu/base.py index f8eb34011..1da698c08 100644 --- a/tests/dictionaries/70service_not_managed/tiramisu/base.py +++ b/tests/dictionaries/70service_not_managed/tiramisu/base.py @@ -2,27 +2,32 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = FilenameOption(name="name", doc="name", default="/tmp/test") -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_8]) -option_6.impl_set_information('source', "test") -option_5 = OptionDescription(name="files", doc="files", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=False) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = FilenameOption(name="name", doc="name", default="/tmp/test") +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="test", doc="test", children=[option_6, option_5]) +optiondescription_4.impl_set_information('source', "test") +optiondescription_3 = OptionDescription(name="files", doc="files", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "none") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70service_not_managed/tiramisu/multi.py b/tests/dictionaries/70service_not_managed/tiramisu/multi.py new file mode 100644 index 000000000..1097c3001 --- /dev/null +++ b/tests/dictionaries/70service_not_managed/tiramisu/multi.py @@ -0,0 +1,47 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = FilenameOption(name="name", doc="name", default="/tmp/test") +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="test", doc="test", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "test") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "none") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = FilenameOption(name="name", doc="name", default="/tmp/test") +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="test", doc="test", children=[option_13, option_12]) +optiondescription_11.impl_set_information('source', "test") +optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_22 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "none") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70service_servicelist/tiramisu/base.py b/tests/dictionaries/70service_servicelist/tiramisu/base.py index 4ee00538f..9ab844d88 100644 --- a/tests/dictionaries/70service_servicelist/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist/tiramisu/base.py @@ -2,22 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_6 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_3 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="test_service", doc="test.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('type', "service") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/70service_servicelist/tiramisu/multi.py b/tests/dictionaries/70service_servicelist/tiramisu/multi.py new file mode 100644 index 000000000..384752ac5 --- /dev/null +++ b/tests/dictionaries/70service_servicelist/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py index 536c20357..a2ad35de1 100644 --- a/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py @@ -2,23 +2,28 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition1", doc="condition1", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="condition2", doc="condition2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_7]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = StrOption(name="condition1", doc="condition1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="condition2", doc="condition2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/multi.py b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/multi.py new file mode 100644 index 000000000..2a7f70834 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/multi.py @@ -0,0 +1,39 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition1", doc="condition1", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = StrOption(name="condition2", doc="condition2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_3 = StrOption(name="condition1", doc="condition1", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = StrOption(name="condition2", doc="condition2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_7 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_4, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="test_service", doc="test.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_servicelist_extra/tiramisu/base.py b/tests/dictionaries/70service_servicelist_extra/tiramisu/base.py index 13dba6999..7eb5c45b1 100644 --- a/tests/dictionaries/70service_servicelist_extra/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_extra/tiramisu/base.py @@ -2,22 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="extra", doc="extra", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_6 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="extra", doc="extra", children=[option_1]) +option_2 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_3 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="test_service", doc="test.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('type', "service") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/70service_servicelist_extra/tiramisu/multi.py b/tests/dictionaries/70service_servicelist_extra/tiramisu/multi.py new file mode 100644 index 000000000..93e8634c2 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_extra/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="extra", doc="extra", children=[option_1]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="extra", doc="extra", children=[option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/70service_servicelist_file/makedict/after.json b/tests/dictionaries/70service_servicelist_file/makedict/after.json index 8c432fa13..b710ae2b4 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/after.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/after.json @@ -13,7 +13,7 @@ }, "services.test_service.files.file.activate": { "owner": "default", - "value": true + "value": false }, "services.test_service.activate": { "owner": "default", diff --git a/tests/dictionaries/70service_servicelist_file/makedict/base.json b/tests/dictionaries/70service_servicelist_file/makedict/base.json index dc6816b93..a45a49d45 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/base.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/base.json @@ -2,7 +2,7 @@ "rougail.condition": "no", "rougail.nut_monitor_host": "192.168.0.1", "services.test_service.files.file.name": "/etc/file", - "services.test_service.files.file.activate": true, + "services.test_service.files.file.activate": false, "services.test_service.activate": false, "services.test_service.manage": true } diff --git a/tests/dictionaries/70service_servicelist_file/makedict/before.json b/tests/dictionaries/70service_servicelist_file/makedict/before.json index 8c432fa13..b710ae2b4 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/before.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/before.json @@ -13,7 +13,7 @@ }, "services.test_service.files.file.activate": { "owner": "default", - "value": true + "value": false }, "services.test_service.activate": { "owner": "default", diff --git a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py index 856e0b75a..d706f8bc3 100644 --- a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = FilenameOption(name="name", doc="name", default="/etc/file") -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) -option_7.impl_set_information('source', "file") -option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = FilenameOption(name="name", doc="name", default="/etc/file") +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6]) +optiondescription_5.impl_set_information('source', "file") +optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/70service_servicelist_file/tiramisu/multi.py b/tests/dictionaries/70service_servicelist_file/tiramisu/multi.py new file mode 100644 index 000000000..f8812fbb4 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_file/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8]) +optiondescription_7.impl_set_information('source', "file") +optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_15 = FilenameOption(name="name", doc="name", default="/etc/file") +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +optiondescription_13 = OptionDescription(name="file", doc="file", children=[option_15, option_14]) +optiondescription_13.impl_set_information('source', "file") +optiondescription_12 = OptionDescription(name="files", doc="files", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py b/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py index 59677746e..0a0ff9b64 100644 --- a/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py @@ -2,27 +2,32 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) -option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_2) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/70service_servicelist_ip/tiramisu/multi.py b/tests/dictionaries/70service_servicelist_ip/tiramisu/multi.py new file mode 100644 index 000000000..3d805c5c7 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_ip/tiramisu/multi.py @@ -0,0 +1,47 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_2) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_8]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_15 = SymLinkOption(name="name", opt=option_4) +option_14 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_13 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_15, option_14]) +optiondescription_12 = OptionDescription(name="ip", doc="ip", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py index c2cbd69d6..aff560bcd 100644 --- a/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py @@ -2,22 +2,27 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_6 = BoolOption(name="manage", doc="manage", default=False) -option_4 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_2 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_3 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_6 = OptionDescription(name="test_service", doc="test.service", children=[option_2, option_3]) +optiondescription_6.impl_set_information('type', "none") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5]) diff --git a/tests/dictionaries/70service_servicelist_not_managed/tiramisu/multi.py b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/multi.py new file mode 100644 index 000000000..e3d80d3bc --- /dev/null +++ b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/multi.py @@ -0,0 +1,37 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_3 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_4 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_10 = OptionDescription(name="test_service", doc="test.service", children=[option_3, option_4]) +optiondescription_10.impl_set_information('type', "none") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8, optiondescription_9]) +option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_6 = BoolOption(name="manage", doc="manage", default=False) +optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[option_5, option_6]) +optiondescription_14.impl_set_information('type', "none") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12, optiondescription_13]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_11]) diff --git a/tests/dictionaries/70service_target/tiramisu/base.py b/tests/dictionaries/70service_target/tiramisu/base.py index a1472e111..efe48fe8f 100644 --- a/tests/dictionaries/70service_target/tiramisu/base.py +++ b/tests/dictionaries/70service_target/tiramisu/base.py @@ -2,24 +2,29 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_6, option_7]) -option_5.impl_set_information('target', "test") -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('target', "test") +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_target/tiramisu/multi.py b/tests/dictionaries/70service_target/tiramisu/multi.py new file mode 100644 index 000000000..2047cdb17 --- /dev/null +++ b/tests/dictionaries/70service_target/tiramisu/multi.py @@ -0,0 +1,41 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('target', "test") +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('target', "test") +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_target_engine/tiramisu/base.py b/tests/dictionaries/70service_target_engine/tiramisu/base.py index 621e8b5bb..c7e43ed55 100644 --- a/tests/dictionaries/70service_target_engine/tiramisu/base.py +++ b/tests/dictionaries/70service_target_engine/tiramisu/base.py @@ -2,25 +2,30 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_6, option_7]) -option_5.impl_set_information('target', "test") -option_5.impl_set_information('engine', "none") -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_7 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_3, option_4]) +optiondescription_7.impl_set_information('target', "test") +optiondescription_7.impl_set_information('engine', "none") +optiondescription_7.impl_set_information('type', "service") +optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_6]) diff --git a/tests/dictionaries/70service_target_engine/tiramisu/multi.py b/tests/dictionaries/70service_target_engine/tiramisu/multi.py new file mode 100644 index 000000000..e604f0c58 --- /dev/null +++ b/tests/dictionaries/70service_target_engine/tiramisu/multi.py @@ -0,0 +1,43 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_5, option_6]) +optiondescription_12.impl_set_information('target', "test") +optiondescription_12.impl_set_information('engine', "none") +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10, optiondescription_11]) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"})) +optiondescription_14 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3]) +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_7, option_8]) +optiondescription_16.impl_set_information('target', "test") +optiondescription_16.impl_set_information('engine', "none") +optiondescription_16.impl_set_information('type', "service") +optiondescription_15 = OptionDescription(name="services", doc="services", children=[optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14, optiondescription_15]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70service_timer/tiramisu/base.py b/tests/dictionaries/70service_timer/tiramisu/base.py index 49d2b2353..54860cd93 100644 --- a/tests/dictionaries/70service_timer/tiramisu/base.py +++ b/tests/dictionaries/70service_timer/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * +option_1 = BoolOption(name="activate", doc="activate", default=True) +option_2 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_6 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_1, option_2]) +optiondescription_6.impl_set_information('engine', "none") +optiondescription_6.impl_set_information('type', "service") option_3 = BoolOption(name="activate", doc="activate", default=True) option_4 = BoolOption(name="manage", doc="manage", default=True) -option_2 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_3, option_4]) -option_2.impl_set_information('engine', "none") -option_6 = BoolOption(name="activate", doc="activate", default=True) -option_7 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="testsrv_timer", doc="testsrv.timer", children=[option_6, option_7]) -option_5.impl_set_information('type', "timer") -option_5.impl_set_information('engine', "none") -option_1 = OptionDescription(name="services", doc="services", children=[option_2, option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) +optiondescription_7 = OptionDescription(name="testsrv_timer", doc="testsrv.timer", children=[option_3, option_4]) +optiondescription_7.impl_set_information('type', "timer") +optiondescription_7.impl_set_information('engine', "none") +optiondescription_5 = OptionDescription(name="services", doc="services", children=[optiondescription_6, optiondescription_7], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5]) diff --git a/tests/dictionaries/70service_timer/tiramisu/multi.py b/tests/dictionaries/70service_timer/tiramisu/multi.py new file mode 100644 index 000000000..4710d0b87 --- /dev/null +++ b/tests/dictionaries/70service_timer/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = BoolOption(name="activate", doc="activate", default=True) +option_2 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_1, option_2]) +optiondescription_11.impl_set_information('engine', "none") +optiondescription_11.impl_set_information('type', "service") +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_4 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="testsrv_timer", doc="testsrv.timer", children=[option_3, option_4]) +optiondescription_12.impl_set_information('type', "timer") +optiondescription_12.impl_set_information('engine', "none") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11, optiondescription_12], properties=frozenset({"hidden"})) +optiondescription_9 = OptionDescription(name="1", doc="1", children=[optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_6 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_15 = OptionDescription(name="testsrv_service", doc="testsrv.service", children=[option_5, option_6]) +optiondescription_15.impl_set_information('engine', "none") +optiondescription_15.impl_set_information('type', "service") +option_7 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_16 = OptionDescription(name="testsrv_timer", doc="testsrv.timer", children=[option_7, option_8]) +optiondescription_16.impl_set_information('type', "timer") +optiondescription_16.impl_set_information('engine', "none") +optiondescription_14 = OptionDescription(name="services", doc="services", children=[optiondescription_15, optiondescription_16], properties=frozenset({"hidden"})) +optiondescription_13 = OptionDescription(name="2", doc="2", children=[optiondescription_14]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_13]) diff --git a/tests/dictionaries/70services_ip/tiramisu/base.py b/tests/dictionaries/70services_ip/tiramisu/base.py index 10b9e794d..b692b928c 100644 --- a/tests/dictionaries/70services_ip/tiramisu/base.py +++ b/tests/dictionaries/70services_ip/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = SymLinkOption(name="name", opt=option_2) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8]) -option_5 = OptionDescription(name="ip", doc="ip", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="nut_service", doc="nut.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip/tiramisu/multi.py b/tests/dictionaries/70services_ip/tiramisu/multi.py new file mode 100644 index 000000000..b049afde8 --- /dev/null +++ b/tests/dictionaries/70services_ip/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_cidr/tiramisu/base.py b/tests/dictionaries/70services_ip_cidr/tiramisu/base.py index bfdea329c..9a332d9cb 100644 --- a/tests/dictionaries/70services_ip_cidr/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_cidr/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = SymLinkOption(name="name", opt=option_2) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8]) -option_5 = OptionDescription(name="ip", doc="ip", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="nut_service", doc="nut.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip_cidr/tiramisu/multi.py b/tests/dictionaries/70services_ip_cidr/tiramisu/multi.py new file mode 100644 index 000000000..d8ea98d8e --- /dev/null +++ b/tests/dictionaries/70services_ip_cidr/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_disabled/tiramisu/base.py b/tests/dictionaries/70services_ip_disabled/tiramisu/base.py index 7c9feb132..48c3e2b43 100644 --- a/tests/dictionaries/70services_ip_disabled/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_disabled/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"disabled", "mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = SymLinkOption(name="name", opt=option_2) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8]) -option_5 = OptionDescription(name="ip", doc="ip", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="nut_service", doc="nut.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip_disabled/tiramisu/multi.py b/tests/dictionaries/70services_ip_disabled/tiramisu/multi.py new file mode 100644 index 000000000..e90f59545 --- /dev/null +++ b/tests/dictionaries/70services_ip_disabled/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"disabled", "mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_extra/00-base.xml b/tests/dictionaries/70services_ip_extra/00-base.xml new file mode 100644 index 000000000..d6fb1be87 --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/00-base.xml @@ -0,0 +1,8 @@ + + + + + extra.nut_monitor_host + + + diff --git a/tests/dictionaries/70services_ip_extra/__init__.py b/tests/dictionaries/70services_ip_extra/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/70services_ip_extra/extra_dirs/extra/00-base.xml b/tests/dictionaries/70services_ip_extra/extra_dirs/extra/00-base.xml new file mode 100644 index 000000000..3ddba60ec --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/extra_dirs/extra/00-base.xml @@ -0,0 +1,8 @@ + + + + + 192.168.0.0/24 + + + diff --git a/tests/dictionaries/70services_ip_extra/makedict/after.json b/tests/dictionaries/70services_ip_extra/makedict/after.json new file mode 100644 index 000000000..0e94fd939 --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/makedict/after.json @@ -0,0 +1,22 @@ +{ + "extra.nut_monitor_host": { + "owner": "default", + "value": "192.168.0.0/24" + }, + "services.nut_service.ip.extra_nut_monitor_host.name": { + "owner": "default", + "value": "192.168.0.0/24" + }, + "services.nut_service.ip.extra_nut_monitor_host.activate": { + "owner": "default", + "value": true + }, + "services.nut_service.activate": { + "owner": "default", + "value": true + }, + "services.nut_service.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/70services_ip_extra/makedict/base.json b/tests/dictionaries/70services_ip_extra/makedict/base.json new file mode 100644 index 000000000..b75e192ad --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/makedict/base.json @@ -0,0 +1,7 @@ +{ + "extra.nut_monitor_host": "192.168.0.0/24", + "services.nut_service.ip.extra_nut_monitor_host.name": "192.168.0.0/24", + "services.nut_service.ip.extra_nut_monitor_host.activate": true, + "services.nut_service.activate": true, + "services.nut_service.manage": true +} diff --git a/tests/dictionaries/70services_ip_extra/makedict/before.json b/tests/dictionaries/70services_ip_extra/makedict/before.json new file mode 100644 index 000000000..0e94fd939 --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/makedict/before.json @@ -0,0 +1,22 @@ +{ + "extra.nut_monitor_host": { + "owner": "default", + "value": "192.168.0.0/24" + }, + "services.nut_service.ip.extra_nut_monitor_host.name": { + "owner": "default", + "value": "192.168.0.0/24" + }, + "services.nut_service.ip.extra_nut_monitor_host.activate": { + "owner": "default", + "value": true + }, + "services.nut_service.activate": { + "owner": "default", + "value": true + }, + "services.nut_service.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/70services_ip_extra/result/systemd/system/nut.service.d/rougail_ip.conf b/tests/dictionaries/70services_ip_extra/result/systemd/system/nut.service.d/rougail_ip.conf new file mode 100644 index 000000000..e1cb437d6 --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/result/systemd/system/nut.service.d/rougail_ip.conf @@ -0,0 +1,3 @@ +[Service] +IPAddressAllow=192.168.0.0/24 +IPAddressDeny=any diff --git a/tests/dictionaries/70services_ip_extra/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/70services_ip_extra/result/tmpfiles.d/0rougail.conf new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/70services_ip_extra/tiramisu/base.py b/tests/dictionaries/70services_ip_extra/tiramisu/base.py new file mode 100644 index 000000000..54989215a --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/tiramisu/base.py @@ -0,0 +1,32 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="extra", doc="extra", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="extra_nut_monitor_host", doc="extra.nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip_extra/tiramisu/multi.py b/tests/dictionaries/70services_ip_extra/tiramisu/multi.py new file mode 100644 index 000000000..5c23863b7 --- /dev/null +++ b/tests/dictionaries/70services_ip_extra/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="extra", doc="extra", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="extra_nut_monitor_host", doc="extra.nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="extra", doc="extra", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="extra_nut_monitor_host", doc="extra.nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_iplist/tiramisu/base.py b/tests/dictionaries/70services_ip_iplist/tiramisu/base.py index 4c31ce5cb..594f8d952 100644 --- a/tests/dictionaries/70services_ip_iplist/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_iplist/tiramisu/base.py @@ -2,27 +2,32 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) -option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")}))})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) -option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="nut_service", doc="nut.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")}))})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_2) +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/70services_ip_iplist/tiramisu/multi.py b/tests/dictionaries/70services_ip_iplist/tiramisu/multi.py new file mode 100644 index 000000000..3f9b7f320 --- /dev/null +++ b/tests/dictionaries/70services_ip_iplist/tiramisu/multi.py @@ -0,0 +1,47 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")}))})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_2) +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_8]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) +option_4 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")}))})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_15 = SymLinkOption(name="name", opt=option_4) +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_13 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_15, option_14]) +optiondescription_12 = OptionDescription(name="ip", doc="ip", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py b/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py index f4ba46411..2e834a670 100644 --- a/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py @@ -2,27 +2,32 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"})) -option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) -option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) -option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_11 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="nut_service", doc="nut.service", children=[option_6, option_10, option_11]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_2) +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_11 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_11.impl_set_information('type', "service") +optiondescription_10 = OptionDescription(name="services", doc="services", children=[optiondescription_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_9, optiondescription_10]) diff --git a/tests/dictionaries/70services_ip_iplist2/tiramisu/multi.py b/tests/dictionaries/70services_ip_iplist2/tiramisu/multi.py new file mode 100644 index 000000000..25b16cc70 --- /dev/null +++ b/tests/dictionaries/70services_ip_iplist2/tiramisu/multi.py @@ -0,0 +1,47 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_2) +option_8 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_1, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_8]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_20 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_6, option_5, option_10]) +optiondescription_20.impl_set_information('type', "service") +optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"})) +optiondescription_17 = OptionDescription(name="1", doc="1", children=[optiondescription_18, optiondescription_19]) +option_3 = StrOption(name="condition", doc="condition", default="yes", properties=frozenset({"mandatory", "normal"})) +option_4 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_22 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_15 = SymLinkOption(name="name", opt=option_4) +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +optiondescription_13 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_15, option_14]) +optiondescription_12 = OptionDescription(name="ip", doc="ip", children=[optiondescription_13]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_24 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_12, option_11, option_16]) +optiondescription_24.impl_set_information('type', "service") +optiondescription_23 = OptionDescription(name="services", doc="services", children=[optiondescription_24], properties=frozenset({"hidden"})) +optiondescription_21 = OptionDescription(name="2", doc="2", children=[optiondescription_22, optiondescription_23]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_17, optiondescription_21]) diff --git a/tests/dictionaries/70services_ip_leadership/tiramisu/base.py b/tests/dictionaries/70services_ip_leadership/tiramisu/base.py index 0aac7a816..941c9ecd0 100644 --- a/tests/dictionaries/70services_ip_leadership/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_leadership/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_4 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", multi=True, default=['255.255.255.0'], properties=frozenset({"mandatory"})) -option_5 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default_multi="192.168.1.0", properties=frozenset({"mandatory", "normal"})) -option_3 = Leadership(name="nut_monitor_netmask", doc="nut_monitor_netmask", children=[option_4, option_5], properties=frozenset({"normal"})) -option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_10 = SymLinkOption(name="name", opt=option_5) -option_11 = SymLinkOption(name="netmask", opt=option_4) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_9 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_10, option_11, option_12]) -option_8 = OptionDescription(name="ip", doc="ip", children=[option_9]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="ntp_service", doc="ntp.service", children=[option_8, option_13, option_14]) -option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) +option_3 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", multi=True, default=['255.255.255.0'], properties=frozenset({"mandatory"})) +option_4 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default_multi="192.168.1.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_2 = Leadership(name="nut_monitor_netmask", doc="nut_monitor_netmask", children=[option_3, option_4], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[optiondescription_2], properties=frozenset({"normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_9 = SymLinkOption(name="name", opt=option_4) +option_10 = SymLinkOption(name="netmask", opt=option_3) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_10, option_8]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="ntp_service", doc="ntp.service", children=[optiondescription_6, option_5, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/70services_ip_leadership/tiramisu/multi.py b/tests/dictionaries/70services_ip_leadership/tiramisu/multi.py new file mode 100644 index 000000000..ab932a485 --- /dev/null +++ b/tests/dictionaries/70services_ip_leadership/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", multi=True, default=['255.255.255.0'], properties=frozenset({"mandatory"})) +option_4 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default_multi="192.168.1.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_2 = Leadership(name="nut_monitor_netmask", doc="nut_monitor_netmask", children=[option_3, option_4], properties=frozenset({"normal"})) +optiondescription_1 = OptionDescription(name="general", doc="général", children=[optiondescription_2], properties=frozenset({"normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1]) +option_13 = SymLinkOption(name="name", opt=option_4) +option_14 = SymLinkOption(name="netmask", opt=option_3) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_14, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_15 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="ntp_service", doc="ntp.service", children=[optiondescription_10, option_9, option_15]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_7 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", multi=True, default=['255.255.255.0'], properties=frozenset({"mandatory"})) +option_8 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default_multi="192.168.1.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_6 = Leadership(name="nut_monitor_netmask", doc="nut_monitor_netmask", children=[option_7, option_8], properties=frozenset({"normal"})) +optiondescription_5 = OptionDescription(name="general", doc="général", children=[optiondescription_6], properties=frozenset({"normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5]) +option_20 = SymLinkOption(name="name", opt=option_8) +option_21 = SymLinkOption(name="netmask", opt=option_7) +option_19 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_18 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_20, option_21, option_19]) +optiondescription_17 = OptionDescription(name="ip", doc="ip", children=[optiondescription_18]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="ntp_service", doc="ntp.service", children=[optiondescription_17, option_16, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/70services_ip_multi/tiramisu/base.py b/tests/dictionaries/70services_ip_multi/tiramisu/base.py index c5da4bcb8..5ce8671f9 100644 --- a/tests/dictionaries/70services_ip_multi/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_multi/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default=['192.168.0.1', '192.168.0.2'], default_multi="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = SymLinkOption(name="name", opt=option_2) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8]) -option_5 = OptionDescription(name="ip", doc="ip", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="nut_service", doc="nut.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default=['192.168.0.1', '192.168.0.2'], default_multi="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip_multi/tiramisu/multi.py b/tests/dictionaries/70services_ip_multi/tiramisu/multi.py new file mode 100644 index 000000000..dfc151d6d --- /dev/null +++ b/tests/dictionaries/70services_ip_multi/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default=['192.168.0.1', '192.168.0.2'], default_multi="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", multi=True, default=['192.168.0.1', '192.168.0.2'], default_multi="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_network/tiramisu/base.py b/tests/dictionaries/70services_ip_network/tiramisu/base.py index 19d61899d..c8f1e31c6 100644 --- a/tests/dictionaries/70services_ip_network/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_network/tiramisu/base.py @@ -2,28 +2,33 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", default="255.255.255.0", properties=frozenset({"mandatory", "normal"})) -option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0", properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = SymLinkOption(name="netmask", opt=option_2) -option_10 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9, option_10]) -option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_12 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="nut_service", doc="nut.service", children=[option_6, option_11, option_12]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +option_1 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", default="255.255.255.0", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_2) +option_8 = SymLinkOption(name="netmask", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_9 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_12 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_9]) +optiondescription_12.impl_set_information('type', "service") +optiondescription_11 = OptionDescription(name="services", doc="services", children=[optiondescription_12], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_10, optiondescription_11]) diff --git a/tests/dictionaries/70services_ip_network/tiramisu/multi.py b/tests/dictionaries/70services_ip_network/tiramisu/multi.py new file mode 100644 index 000000000..594a4fb3b --- /dev/null +++ b/tests/dictionaries/70services_ip_network/tiramisu/multi.py @@ -0,0 +1,49 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", default="255.255.255.0", properties=frozenset({"mandatory", "normal"})) +option_2 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_2) +option_10 = SymLinkOption(name="netmask", opt=option_1) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_10, option_8]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_6, option_5, option_11]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="1", doc="1", children=[optiondescription_20, optiondescription_21]) +option_3 = NetmaskOption(name="nut_monitor_netmask", doc="nut_monitor_netmask", default="255.255.255.0", properties=frozenset({"mandatory", "normal"})) +option_4 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0", properties=frozenset({"mandatory", "normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_16 = SymLinkOption(name="name", opt=option_4) +option_17 = SymLinkOption(name="netmask", opt=option_3) +option_15 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_14 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_16, option_17, option_15]) +optiondescription_13 = OptionDescription(name="ip", doc="ip", children=[optiondescription_14]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_18 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_13, option_12, option_18]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="2", doc="2", children=[optiondescription_24, optiondescription_25]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_19, optiondescription_23]) diff --git a/tests/dictionaries/70services_ip_not_mandatory/tiramisu/base.py b/tests/dictionaries/70services_ip_not_mandatory/tiramisu/base.py index 2855de842..b0629b66d 100644 --- a/tests/dictionaries/70services_ip_not_mandatory/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_not_mandatory/tiramisu/base.py @@ -2,26 +2,31 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) -option_7 = SymLinkOption(name="name", opt=option_2) -option_8 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_8]) -option_5 = OptionDescription(name="ip", doc="ip", children=[option_6]) -option_9 = BoolOption(name="activate", doc="activate", default=True) -option_10 = BoolOption(name="manage", doc="manage", default=True) -option_4 = OptionDescription(name="nut_service", doc="nut.service", children=[option_5, option_9, option_10]) -option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_6 = SymLinkOption(name="name", opt=option_1) +option_5 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_4 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_6, option_5]) +optiondescription_3 = OptionDescription(name="ip", doc="ip", children=[optiondescription_4]) +option_2 = BoolOption(name="activate", doc="activate", default=True) +option_7 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_10 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_3, option_2, option_7]) +optiondescription_10.impl_set_information('type', "service") +optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_8, optiondescription_9]) diff --git a/tests/dictionaries/70services_ip_not_mandatory/tiramisu/multi.py b/tests/dictionaries/70services_ip_not_mandatory/tiramisu/multi.py new file mode 100644 index 000000000..18754cacc --- /dev/null +++ b/tests/dictionaries/70services_ip_not_mandatory/tiramisu/multi.py @@ -0,0 +1,45 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[option_1]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_8 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_18 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_8]) +optiondescription_18.impl_set_information('type', "service") +optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"})) +optiondescription_15 = OptionDescription(name="1", doc="1", children=[optiondescription_16, optiondescription_17]) +option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", allow_reserved=True, properties=frozenset({"normal"})) +optiondescription_20 = OptionDescription(name="rougail", doc="Rougail", children=[option_2]) +option_13 = SymLinkOption(name="name", opt=option_2) +option_12 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_11 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_13, option_12]) +optiondescription_10 = OptionDescription(name="ip", doc="ip", children=[optiondescription_11]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_22 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_10, option_9, option_14]) +optiondescription_22.impl_set_information('type', "service") +optiondescription_21 = OptionDescription(name="services", doc="services", children=[optiondescription_22], properties=frozenset({"hidden"})) +optiondescription_19 = OptionDescription(name="2", doc="2", children=[optiondescription_20, optiondescription_21]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_19]) diff --git a/tests/dictionaries/70services_ip_twice/tiramisu/base.py b/tests/dictionaries/70services_ip_twice/tiramisu/base.py index 60214cfa8..f09de0ecd 100644 --- a/tests/dictionaries/70services_ip_twice/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_twice/tiramisu/base.py @@ -2,30 +2,35 @@ 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 class func: pass -_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') -_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 - setattr(func, function, getattr(_func, function)) + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') try: from tiramisu3 import * except: from tiramisu import * -option_2 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_3 = IPOption(name="nut_monitor_host2", doc="nut_monitor_host2", default="192.168.0.2", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) -option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3]) -option_8 = SymLinkOption(name="name", opt=option_2) +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host2", doc="nut_monitor_host2", default="192.168.0.2", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_7 = SymLinkOption(name="name", opt=option_1) +option_6 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_5 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_7, option_6]) +option_10 = SymLinkOption(name="name", opt=option_2) option_9 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) -option_11 = SymLinkOption(name="name", opt=option_3) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_10 = OptionDescription(name="nut_monitor_host2", doc="nut_monitor_host2", children=[option_11, option_12]) -option_6 = OptionDescription(name="ip", doc="ip", children=[option_7, option_10]) -option_13 = BoolOption(name="activate", doc="activate", default=True) -option_14 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="nut_service", doc="nut.service", children=[option_6, option_13, option_14]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) +optiondescription_8 = OptionDescription(name="nut_monitor_host2", doc="nut_monitor_host2", children=[option_10, option_9]) +optiondescription_4 = OptionDescription(name="ip", doc="ip", children=[optiondescription_5, optiondescription_8]) +option_3 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_14 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_4, option_3, option_11]) +optiondescription_14.impl_set_information('type', "service") +optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13]) diff --git a/tests/dictionaries/70services_ip_twice/tiramisu/multi.py b/tests/dictionaries/70services_ip_twice/tiramisu/multi.py new file mode 100644 index 000000000..4238af790 --- /dev/null +++ b/tests/dictionaries/70services_ip_twice/tiramisu/multi.py @@ -0,0 +1,53 @@ +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 +class func: + pass + +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 + setattr(func, function, getattr(func_, function)) +_load_functions('tests/dictionaries/../eosfunc/test.py') +try: + from tiramisu3 import * +except: + from tiramisu import * +option_1 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +option_2 = IPOption(name="nut_monitor_host2", doc="nut_monitor_host2", default="192.168.0.2", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2]) +option_9 = SymLinkOption(name="name", opt=option_1) +option_8 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_9, option_8]) +option_12 = SymLinkOption(name="name", opt=option_2) +option_11 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_10 = OptionDescription(name="nut_monitor_host2", doc="nut_monitor_host2", children=[option_12, option_11]) +optiondescription_6 = OptionDescription(name="ip", doc="ip", children=[optiondescription_7, optiondescription_10]) +option_5 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_26 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_6, option_5, option_13]) +optiondescription_26.impl_set_information('type', "service") +optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"})) +optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25]) +option_3 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +option_4 = IPOption(name="nut_monitor_host2", doc="nut_monitor_host2", default="192.168.0.2", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) +optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4]) +option_18 = SymLinkOption(name="name", opt=option_3) +option_17 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_16 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_18, option_17]) +option_21 = SymLinkOption(name="name", opt=option_4) +option_20 = BoolOption(name="activate", doc="activate", default=True) +optiondescription_19 = OptionDescription(name="nut_monitor_host2", doc="nut_monitor_host2", children=[option_21, option_20]) +optiondescription_15 = OptionDescription(name="ip", doc="ip", children=[optiondescription_16, optiondescription_19]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_22 = BoolOption(name="manage", doc="manage", default=True) +optiondescription_30 = OptionDescription(name="nut_service", doc="nut.service", children=[optiondescription_15, option_14, option_22]) +optiondescription_30.impl_set_information('type', "service") +optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"})) +optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29]) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27]) diff --git a/tests/dictionaries/80condition_itself/00-base.xml b/tests/dictionaries/80condition_itself/00-base.xml index 96ab58162..e4dfbd69e 100644 --- a/tests/dictionaries/80condition_itself/00-base.xml +++ b/tests/dictionaries/80condition_itself/00-base.xml @@ -8,7 +8,7 @@ leader-leader - replicationType + replicationtype diff --git a/tests/dictionaries/80family_dynamic_with_family/00-base.xml b/tests/dictionaries/80family_dynamic_with_family/00-base.xml index f62b708c7..294f8b959 100644 --- a/tests/dictionaries/80family_dynamic_with_family/00-base.xml +++ b/tests/dictionaries/80family_dynamic_with_family/00-base.xml @@ -9,7 +9,9 @@ - + + + diff --git a/tests/dictionaries/80leadership_mandatoryfollower_multi_value/00-base.xml b/tests/dictionaries/80leadership_mandatoryfollower_multi_value/00-base.xml new file mode 100644 index 000000000..fcf3229ff --- /dev/null +++ b/tests/dictionaries/80leadership_mandatoryfollower_multi_value/00-base.xml @@ -0,0 +1,18 @@ + + + + + + + + + 192.168.0.0 + 192.168.1.0 + + + + + + diff --git a/tests/dictionaries/80leadership_mandatoryfollower_multi_value/__init__.py b/tests/dictionaries/80leadership_mandatoryfollower_multi_value/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/80leadership_mandatoryfollower_multi_value/errno_87 b/tests/dictionaries/80leadership_mandatoryfollower_multi_value/errno_87 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_1_flattener.py b/tests/test_1_flattener.py index 45ab01316..91b02c86e 100644 --- a/tests/test_1_flattener.py +++ b/tests/test_1_flattener.py @@ -26,10 +26,10 @@ for test in listdir(dico_dirs): test_raise.add(test) excludes = set([]) -#excludes = set(['01base_file_utfchar']) +#excludes = set(['70services_ip_extra']) test_ok -= excludes test_raise -= excludes -#test_ok = ['70container_filesredefine'] +#test_ok = ['01base_provider_extra'] #test_ok = [] #test_raise = ['80auto_autofreeze'] #test_raise = [] @@ -55,29 +55,40 @@ def test_dir_error(request): return request.param -def launch_flattener(test_dir, test_ok=False): +def load_rougail_object(test_dir): + rougailconfig = RougailConfig.copy() + rougailconfig['functions_file'] = join(dico_dirs, '../eosfunc/test.py') dirs = [test_dir] subfolder = join(test_dir, 'subfolder') if isdir(subfolder): dirs.append(subfolder) - RougailConfig['dictionaries_dir'] = dirs - RougailConfig['extra_dictionaries'] = {} + rougailconfig['dictionaries_dir'] = dirs + rougailconfig['extra_dictionaries'] = {} if isdir(join(test_dir, 'extra_dirs')): extras = listdir(join(test_dir, 'extra_dirs')) extras.sort() for extra in extras: subfolder = join(test_dir, 'extra_dirs', extra) if isdir(subfolder): - RougailConfig['extra_dictionaries'][extra] = [subfolder] - eosfunc = join(dico_dirs, '../eosfunc/test.py') - RougailConfig['functions_file'] = eosfunc - eolobj = RougailConvert() + rougailconfig['extra_dictionaries'][extra] = [subfolder] + return RougailConvert(rougailconfig) + + +def launch_flattener(eolobj, path_prefix=None): + eolobj.load_dictionaries(path_prefix=path_prefix) + + +def save(test_dir, eolobj, multi=False): tiramisu_objects = eolobj.save(None) if 'children=[]' in tiramisu_objects.split('\n')[-2]: raise Exception('empty tiramisu object?') tiramisu_dir = join(test_dir, 'tiramisu') if isdir(tiramisu_dir): - tiramisu_file = join(tiramisu_dir, 'base.py') + if not multi: + filename = 'base.py' + else: + filename = 'multi.py' + tiramisu_file = join(tiramisu_dir, filename) if not isfile(tiramisu_file) or debug: with open(tiramisu_file, 'w') as fh: fh.write(tiramisu_objects) @@ -89,7 +100,19 @@ def launch_flattener(test_dir, test_ok=False): def test_dictionary(test_dir): assert getcwd() == ORI_DIR test_dir = join(dico_dirs, test_dir) - launch_flattener(test_dir, True) + eolobj = load_rougail_object(test_dir) + launch_flattener(eolobj) + save(test_dir, eolobj) + assert getcwd() == ORI_DIR + + +def test_dictionary_multi(test_dir): + assert getcwd() == ORI_DIR + test_dir = join(dico_dirs, test_dir) + eolobj = load_rougail_object(test_dir) + launch_flattener(eolobj, path_prefix='1') + launch_flattener(eolobj, path_prefix='2') + save(test_dir, eolobj, multi=True) assert getcwd() == ORI_DIR @@ -97,14 +120,17 @@ def test_error_dictionary(test_dir_error): assert getcwd() == ORI_DIR test_dir = join(dico_dirs, test_dir_error) errno = 0 + eolobj = load_rougail_object(test_dir) for i in listdir(test_dir): if i.startswith('errno_'): if errno: raise Exception('multiple errno') errno = int(i.split('_')[1]) with raises(DictConsistencyError) as err: - launch_flattener(test_dir) + launch_flattener(eolobj) + save(test_dir, eolobj) if err.value.errno != errno: print(f'expected errno: {errno}, errno: {err.value.errno}') - launch_flattener(test_dir) + launch_flattener(eolobj) + save(test_dir, eolobj) assert getcwd() == ORI_DIR diff --git a/tests/test_2_makedict.py b/tests/test_2_makedict.py index 9d3d41992..80d138fc6 100644 --- a/tests/test_2_makedict.py +++ b/tests/test_2_makedict.py @@ -37,13 +37,15 @@ def test_dir(request): return request.param -async def launch_flattener(test_dir): +async def launch_flattener(test_dir, + filename, + ): makedict_dir = join(test_dir, 'makedict') makedict_file = join(makedict_dir, 'base.json') makedict_before = join(makedict_dir, 'before.json') makedict_after = join(makedict_dir, 'after.json') - modulepath = test_dir.replace('/', '.') + '.tiramisu.base' + modulepath = test_dir.replace('/', '.') + f'.tiramisu.{filename}' mod = __import__(modulepath) for token in modulepath.split(".")[1:]: mod = getattr(mod, token) @@ -61,18 +63,35 @@ async def launch_flattener(test_dir): await config.property.pop('mandatory') await config.information.set('info', 'value') config_dict = await config.value.dict(leader_to_list=True) - if not isdir(makedict_dir): - mkdir(makedict_dir) - if not isfile(makedict_file) or debug: - with open(makedict_file, 'w') as fh: - dump(config_dict, fh, indent=4) - fh.write('\n') + if filename == 'base': + if not isdir(makedict_dir): + mkdir(makedict_dir) + if not isfile(makedict_file) or debug: + with open(makedict_file, 'w') as fh: + dump(config_dict, fh, indent=4) + fh.write('\n') + else: + config_dict_prefix = {'1': {}, '2': {}} + for key, value in config_dict.items(): + prefix, path = key.split('.', 1) + if value and isinstance(value, list) and isinstance(value[0], dict): + new_value = [] + for dct in value: + new_dct = {} + for k, v in dct.items(): + k = k.split('.', 1)[-1] + new_dct[k] = v + new_value.append(new_dct) + value = new_value + config_dict_prefix[prefix][path] = value + assert loads(dumps(config_dict_prefix['1'])) == loads(dumps(config_dict_prefix['2'])) + config_dict = config_dict_prefix['1'] if not isfile(makedict_file): raise Exception('dict is not empty') with open(makedict_file, 'r') as fh: assert load(fh) == loads(dumps(config_dict)), f"error in file {makedict_file}" # - await value_owner(makedict_before, config) + await value_owner(makedict_before, config, filename) # deploy ro = await config.property.getdefault('read_only', 'append') ro = frozenset(list(ro) + ['force_store_value']) @@ -82,9 +101,10 @@ async def launch_flattener(test_dir): await config.property.setdefault(rw, 'read_write', 'append') await config.property.add('force_store_value') # - await value_owner(makedict_after, config) + await value_owner(makedict_after, config, filename) -async def value_owner(makedict_value_owner, config): + +async def value_owner(makedict_value_owner, config, filename): ret = {} for key in await config.option.list(recursive=True): path = await key.option.path() @@ -105,16 +125,29 @@ async def value_owner(makedict_value_owner, config): ret[path] = {'owner': owner, 'value': value, } - if not isfile(makedict_value_owner) or debug: - with open(makedict_value_owner, 'w') as fh: - dump(ret, fh, indent=4) - fh.write('\n') + if filename == 'base': + if not isfile(makedict_value_owner) or debug: + with open(makedict_value_owner, 'w') as fh: + dump(ret, fh, indent=4) + fh.write('\n') + else: + ret_prefix = {'1': {}, '2': {}} + for key, value in ret.items(): + prefix, path = key.split('.', 1) + ret_prefix[prefix][path] = value + assert loads(dumps(ret_prefix['1'])) == loads(dumps(ret_prefix['2'])) + ret = ret_prefix['1'] with open(makedict_value_owner, 'r') as fh: assert load(fh) == loads(dumps(ret)), f"error in file {makedict_value_owner}" - @mark.asyncio async def test_dictionary(test_dir): test_dir = join(dico_dirs, test_dir) - await launch_flattener(test_dir) + await launch_flattener(test_dir, 'base') + + +@mark.asyncio +async def test_dictionary_multi(test_dir): + test_dir = join(dico_dirs, test_dir) + await launch_flattener(test_dir, 'multi') diff --git a/tests/test_3_template.py b/tests/test_3_template.py index 4507a650e..4aa0d814f 100644 --- a/tests/test_3_template.py +++ b/tests/test_3_template.py @@ -39,17 +39,19 @@ def find_files(dirname: str, files.add(join(*root_file)) -@mark.asyncio -async def test_dictionary(test_dir): +async def template(test_dir, filename, root): test_dir = join(template_dirs, test_dir) - tmp_dir = join(test_dir, 'tmp') + tmp_dir = join(test_dir, '..', 'tmp') - modulepath = test_dir.replace('/', '.') + '.tiramisu.base' + modulepath = test_dir.replace('/', '.') + f'.tiramisu.{filename}' mod = __import__(modulepath) for token in modulepath.split(".")[1:]: mod = getattr(mod, token) config = await Config(mod.option_0) await config.property.read_only() + if filename == 'multi': + sconfig = config + config = config.option(root) funcs_file = join(template_dirs, '../eosfunc/test.py') distrib_dir = join(test_dir, 'tmpl') @@ -99,3 +101,18 @@ async def test_dictionary(test_dir): assert result_file == generated_file, f'{template_file} content : \n{generated_file}\nexpected: \nresult_file\n' rmtree(dest_dir) rmtree(tmp_dir) + + +@mark.asyncio +async def test_template(test_dir): + await template(test_dir, 'base', '1') + + +@mark.asyncio +async def test_template_multi_1(test_dir): + await template(test_dir, 'multi', '1') + + +@mark.asyncio +async def test_template_multi_2(test_dir): + await template(test_dir, 'multi', '1') diff --git a/tests/test_others.py b/tests/test_others.py index c9751f995..0e941e4c2 100644 --- a/tests/test_others.py +++ b/tests/test_others.py @@ -11,18 +11,24 @@ def test_no_dtd(): def test_mode_invalid_default(): + # default variable mode is not in modes_level RougailConfig['dictionaries_dir'] = ['tests/personalize_mode/dictionary'] RougailConfig['modes_level'] = ('level1', 'level2') - with raises(DictConsistencyError): - eolobj = RougailConvert() + eolobj = RougailConvert() + with raises(DictConsistencyError) as err: + eolobj.reflexion() + assert err.value.errno == 72 def test_mode_invalid_default_family(): + # default family mode is not in modes_level RougailConfig['dictionaries_dir'] = ['tests/personalize_mode/dictionary'] RougailConfig['modes_level'] = ('level1', 'level2') RougailConfig['default_variable_mode'] = 'level1' - with raises(DictConsistencyError): - eolobj = RougailConvert() + eolobj = RougailConvert() + with raises(DictConsistencyError) as err: + eolobj.reflexion() + assert err.value.errno == 73 def test_personalize_mode(): @@ -35,9 +41,12 @@ def test_personalize_mode(): def test_personalize_mode_unknown(): + # a variable has an unknown mode RougailConfig['dictionaries_dir'] = ['tests/personalize_mode/dictionary'] RougailConfig['modes_level'] = ('level1',) RougailConfig['default_variable_mode'] = 'level1' RougailConfig['default_family_mode'] = 'level1' - with raises(DictConsistencyError): - eolobj = RougailConvert() + eolobj = RougailConvert() + with raises(DictConsistencyError) as err: + eolobj.reflexion() + assert err.value.errno == 71 diff --git a/tests/test_upgrade.py b/tests/test_upgrade.py index 5cd5aa119..c27779655 100644 --- a/tests/test_upgrade.py +++ b/tests/test_upgrade.py @@ -11,7 +11,7 @@ from rougail.error import DictConsistencyError dico_dirs = 'tests/dictionaries_old' -dest_dir = 'tests/tmp' +dest_dir = 'tmp' test_ok = set() @@ -78,6 +78,7 @@ def launch_test(test_dir): copyfile(src_filename, dst_filename) elif filename in ['tmpl', 'makedict', 'tiramisu', 'result', 'patches']: copytree(src_filename, dst_filename, symlinks=True) + rmtree(dest_dir) def test_dictionary(test_dir):