diff --git a/doc/README.md b/doc/README.md index b31e5a66..65017bfb 100644 --- a/doc/README.md +++ b/doc/README.md @@ -2,10 +2,12 @@ ## Les variables - - [Le conteneur des variables](variables.md) - [Les familles](family/README.md) - [Les variables](variable/README.md) +## Les services + ## Les contraintes - [Les calcules automatiques](fill/README.md) + - [Les vérifications des valeurs](check/README.md) diff --git a/doc/check.rst b/doc/check.rst deleted file mode 100644 index 451dba53..00000000 --- a/doc/check.rst +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/doc/condition.rst b/doc/condition.rst index c42ac529..12542ce6 100644 --- a/doc/condition.rst +++ b/doc/condition.rst @@ -1 +1,10 @@ +FIXME + + + + + + + + diff --git a/doc/fill/param.md b/doc/fill/param.md index 79e9947e..d9d274ca 100644 --- a/doc/fill/param.md +++ b/doc/fill/param.md @@ -95,6 +95,8 @@ Créons deux variables avec une contrainte de type variable qui contient le nom Si l'utilisateur laisse la valeur 1 à "my_variable", la valeur par défault de la variable "my_calculated_variable" sera "no". Si la valeur de "my_variable" est différent de 1, la valeur par défaut de la variable "my_calculated_variable" sera "yes". +[Les variables meneuses ou suiveuses](../variable/leadership.md) peuvent être utilisé sans soucis commme paramètre. + ### Paramètre avec variable potentiellement non existante Suivant le contexte une variable peut exister ou ne pas exister. @@ -120,20 +122,29 @@ Si maintenant on créé un nouveau dictionnaire en créant cette variable, la fo ### Paramètre avec variable potentiellement désactivée -FIXME : +Si une variable est désactivé, l'utilisation de cette variable peut poser problème. -Il n'y a pas spécialement de test ! +Il est possible de ne pas générer d'erreur si une variable est désactivé en utilisant le paramètre "propertyerror" : -### Paramètre avec variable suiveuse +``` + + + + no + + + + + -[variable suiveuse](variable/leadership.md) + + + variable1 + + +``` -FIXME : - -- tests/flattener_dicos/10leadership_append/00-base.xml -- tests/flattener_dicos/10leadership_auto/00-base.xml -- tests/flattener_dicos/10leadership_autoleader/00-base.xml -- tests/flattener_dicos/10leadership_autoleader_expert/00-base.xml +Dans ce cas, le paramètre n'est jamais donnée à la fonction de destination. ### Paramètre avec variable dynamique diff --git a/doc/fill/redefine.md b/doc/fill/redefine.md index f29fd0e8..f3706057 100644 --- a/doc/fill/redefine.md +++ b/doc/fill/redefine.md @@ -58,4 +58,3 @@ Dans un second dictionnaire supprimer ce calcul : ``` - diff --git a/doc/fill/value.md b/doc/fill/value.md index 8d33a681..0d09d843 100644 --- a/doc/fill/value.md +++ b/doc/fill/value.md @@ -44,6 +44,13 @@ En ajoutant le paramètre "hidden" à "True" dans la variable précédente, l'ut Si une condition "hidden_if_in" est spécifié à la variable, la valeur sera modifiable par l'utilisateur si elle n'est pas cachée mais elle sera systèmatiquement calculée (même si elle a déjà était modifiée) si la variable est cachée. +## Variable meneuse ou suiveuse avec valeur calculé + +Une [variable suiveuse](../variable/leadership.md) ne peut pas être calculé automatiquement. +Une [variable meneuse](../variable/leadership.md) peut être calculé automatiquement. +Si la variable n'est pas multiple, il ne faut pas que le calcule retourne une liste. + + ## Variable dynamique avec une valeur calculée Il est également possible de calculer [une variable d'une famille dynamique](family/auto.md) à partir d'une variable standard : diff --git a/doc/variable/simple.md b/doc/variable/simple.md index d9629d3f..df01decd 100644 --- a/doc/variable/simple.md +++ b/doc/variable/simple.md @@ -190,6 +190,8 @@ Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont automatiquement modifiées que si elles ont une valeurs. +Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_save. + ## Variable à valeur en lecture seule automatique Une variable avec valeur en lecture seule automatique est une variable dont la valeur ne sera plus modifiable par l'utilisateur quand le serveur sera déployé. @@ -204,3 +206,5 @@ Dans ce cas la valeur est fixée à la valeur actuelle et elle ne sera plus modi Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée. Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles sont une valeurs. + +Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_freeze. diff --git a/src/rougail/annotator/check.py b/src/rougail/annotator/check.py index 5b1b337f..bf3a3a96 100644 --- a/src/rougail/annotator/check.py +++ b/src/rougail/annotator/check.py @@ -27,14 +27,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from typing import List, Any from .variable import CONVERT_OPTION +from .target import TargetAnnotator +from .param import ParamAnnotator from ..utils import load_modules from ..i18n import _ -from ..error import DictConsistencyError +from ..error import DictConsistencyError, display_xmlfiles INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier'] -class CheckAnnotator: +class CheckAnnotator(TargetAnnotator, ParamAnnotator): """Annotate check """ def __init__(self, @@ -45,12 +47,19 @@ class CheckAnnotator: not hasattr(objectspace.space.constraints, 'check'): return self.objectspace = objectspace + self.let_none = True + self.only_variable = True self.functions = dir(load_modules(eosfunc_file)) self.functions.extend(INTERNAL_FUNCTIONS) + self.target_is_uniq = False + self.convert_target(self.objectspace.space.constraints.check) + self.convert_param(self.objectspace.space.constraints.check) self.check_check() self.check_valid_enum() self.check_change_warning() + self.convert_valid_entier() self.convert_check() + del objectspace.space.constraints.check def check_check(self): # pylint: disable=R0912 """valid and manage @@ -58,56 +67,14 @@ class CheckAnnotator: remove_indexes = [] for check_idx, check in enumerate(self.objectspace.space.constraints.check): if not check.name in self.functions: - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'cannot find check function "{check.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 1) - check_name = check.target - # let's replace the target by the an object - try: - check.target = self.objectspace.paths.get_variable(check.target) - except DictConsistencyError as err: - if err.errno == 36: - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'the target "{check.target}" in check cannot be a dynamic ' - f'variable in {xmlfiles}') - raise DictConsistencyError(msg, 22) from err - raise err - check.is_in_leadership = self.objectspace.paths.is_in_leadership(check_name) - if not hasattr(check, 'param'): - continue - param_option_indexes = [] - for idx, param in enumerate(check.param): - if param.type == 'variable': - if not self.objectspace.paths.path_is_defined(param.text): - if not param.optional: - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'cannot find check param "{param.text}" in {xmlfiles}') - raise DictConsistencyError(msg, 2) - param_option_indexes.append(idx) - else: - # let's replace params by the path - param.text = self.objectspace.paths.get_variable(param.text) - param_option_indexes.sort(reverse=True) - for idx in param_option_indexes: - check.param.pop(idx) - if check.param == []: + msg = _(f'cannot find check function "{check.name}"') + raise DictConsistencyError(msg, 1, check.xmlfiles) + if hasattr(check, 'param') and check.param == []: remove_indexes.append(check_idx) remove_indexes.sort(reverse=True) for idx in remove_indexes: del self.objectspace.space.constraints.check[idx] - @staticmethod - def check_valid_enum_value(variable, - values, - ) -> None: - """check that values in valid_enum are valid - """ - for value in variable.value: - if value.name not in values: - msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list ' - f'of all expected values ({values})') - raise DictConsistencyError(msg, 15) - def check_valid_enum(self): """verify valid_enum """ @@ -115,32 +82,30 @@ class CheckAnnotator: for idx, check in enumerate(self.objectspace.space.constraints.check): if check.name != 'valid_enum': continue - if check.target.path in self.objectspace.valid_enums: - check_xmlfiles = self.objectspace.valid_enums[check.target.path]['xmlfiles'] - old_xmlfiles = self.objectspace.display_xmlfiles(check_xmlfiles) - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'valid_enum define in {xmlfiles} but already set in {old_xmlfiles} ' - f'for "{check.target.name}", did you forget remove_check?') - raise DictConsistencyError(msg, 3) - if not hasattr(check, 'param'): - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'param is mandatory for a valid_enum of variable "{check.target.name}" ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 4) - variable_type = check.target.type - values = self._set_valid_enum(check.target, - check, - ) - if values: - if hasattr(check.target, 'value'): - # check value - self.check_valid_enum_value(check.target, values) - else: - # no value, set the first choice has default value - new_value = self.objectspace.value(check.xmlfiles) - new_value.name = values[0] - new_value.type = variable_type - check.target.value = [new_value] + for target in check.target: + if target.name.path in self.objectspace.valid_enums: + check_xmlfiles = display_xmlfiles(self.objectspace.valid_enums\ + [target.name.path]['xmlfiles']) + msg = _(f'valid_enum already set in {check_xmlfiles} ' + f'for "{target.name.name}", you may have forget remove_check') + raise DictConsistencyError(msg, 3, check.xmlfiles) + if not hasattr(check, 'param'): + msg = _(f'param is mandatory for a valid_enum of variable "{target.name.name}"') + raise DictConsistencyError(msg, 4, check.xmlfiles) + variable_type = target.name.type + values = self._set_valid_enum(target.name, + check, + ) + if values: + if hasattr(target.name, 'value'): + # check value + self.check_valid_enum_value(target.name, values) + else: + # no value, set the first choice has default value + new_value = self.objectspace.value(check.xmlfiles) + new_value.name = values[0] + new_value.type = variable_type + target.name.value = [new_value] remove_indexes.append(idx) remove_indexes.sort(reverse=True) for idx in remove_indexes: @@ -161,47 +126,36 @@ class CheckAnnotator: values = [] for param in check.param: if has_variable: - xmlfiles = self.objectspace.display_xmlfiles(param.xmlfiles) msg = _(f'only one "variable" parameter is allowed for valid_enum ' - f'of variable "{variable.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 5) + f'of variable "{variable.name}"') + raise DictConsistencyError(msg, 5, param.xmlfiles) param_type = variable_type if param.type == 'variable': has_variable = True if param.optional is True: - xmlfiles = self.objectspace.display_xmlfiles(param.xmlfiles) msg = _(f'optional parameter in valid_enum for variable "{variable.name}" ' - f'is not allowed in {xmlfiles}') - raise DictConsistencyError(msg, 14) - param_variable = param.text - if not param_variable.multi: - xmlfiles = self.objectspace.display_xmlfiles(param.xmlfiles) + f'is not allowed') + raise DictConsistencyError(msg, 14, param.xmlfiles) + if not param.text.multi: msg = _(f'only multi "variable" parameter is allowed for valid_enum ' - f'of variable "{variable.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 6) + f'of variable "{variable.name}"') + raise DictConsistencyError(msg, 6, param.xmlfiles) param_type = 'calculation' value = param.text + elif param.type == 'nil': + value = None else: if 'type' in vars(param) and variable_type != param.type: - xmlfiles = self.objectspace.display_xmlfiles(param.xmlfiles) msg = _(f'parameter in valid_enum has incompatible type "{param.type}" ' - f'with type of the variable "{variable.name}" ("{variable_type}") ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 7) + f'with type of the variable "{variable.name}" ("{variable_type}")') + raise DictConsistencyError(msg, 7, param.xmlfiles) if hasattr(param, 'text'): try: value = CONVERT_OPTION[variable_type].get('func', str)(param.text) except ValueError as err: msg = _(f'unable to change type of a valid_enum entry "{param.text}" ' f'is not a valid "{variable_type}" for "{variable.name}"') - raise DictConsistencyError(msg, 13) from err - else: - if param.type == 'number': - xmlfiles = self.objectspace.display_xmlfiles(param.xmlfiles) - msg = _('param type is number, so value is mandatory for valid_enum ' - f'of variable "{variable.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 8) - value = None + raise DictConsistencyError(msg, 13, variable.xmlfiles) from err values.append(value) choice = self.objectspace.choice(variable.xmlfiles) choice.name = value @@ -211,12 +165,25 @@ class CheckAnnotator: if has_variable: return None - self.objectspace.valid_enums[check.target.path] = {'type': variable_type, - 'values': values, - 'xmlfiles': check.xmlfiles, - } + for target in check.target: + self.objectspace.valid_enums[target.name.path] = {'type': variable_type, + 'values': values, + 'xmlfiles': check.xmlfiles, + } return values + @staticmethod + def check_valid_enum_value(variable, + values, + ) -> None: + """check that values in valid_enum are valid + """ + for value in variable.value: + if value.name not in values: + msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list ' + f'of all expected values ({values})') + raise DictConsistencyError(msg, 15, value.xmlfiles) + def check_change_warning(self): """convert level to "warnings_only" """ @@ -224,30 +191,38 @@ class CheckAnnotator: check.warnings_only = check.level == 'warning' check.level = None + def convert_valid_entier(self) -> None: + """valid and manage + """ + remove_indexes = [] + for check_idx, check in enumerate(self.objectspace.space.constraints.check): + if not check.name == 'valid_entier': + continue + remove_indexes.append(check_idx) + if not hasattr(check, 'param'): + msg = _(f'{check.name} must have, at least, 1 param') + raise DictConsistencyError(msg, 17, check.xmlfiles) + for param in check.param: + if param.type != 'number': + msg = _(f'param in "valid_entier" must be an "integer", not "{param.type}"') + raise DictConsistencyError(msg, 18, check.xmlfiles) + for target in check.target: + if param.name == 'mini': + target.name.min_number = int(param.text) + elif param.name == 'maxi': + target.name.max_number = int(param.text) + else: + msg = _(f'unknown parameter "{param.name}" in check "valid_entier"') + raise DictConsistencyError(msg, 19, check.xmlfiles) + remove_indexes.sort(reverse=True) + for idx in remove_indexes: + del self.objectspace.space.constraints.check[idx] + def convert_check(self) -> None: """valid and manage """ for check in self.objectspace.space.constraints.check: - if check.name == 'valid_entier': - if not hasattr(check, 'param'): - msg = _(f'{check.name} must have, at least, 1 param') - raise DictConsistencyError(msg, 17) - for param in check.param: - if param.type != 'number': - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'param in "valid_entier" must be an "integer", not "{param.type}"' - f' in {xmlfiles}') - raise DictConsistencyError(msg, 18) - if param.name == 'mini': - check.target.min_number = int(param.text) - elif param.name == 'maxi': - check.target.max_number = int(param.text) - else: - xmlfiles = self.objectspace.display_xmlfiles(check.xmlfiles) - msg = _(f'unknown parameter "{param.name}" in check "valid_entier" ' - f'for variable "{check.target.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 19) - continue - if not hasattr(check.target, 'validators'): - check.target.validators = [] - check.target.validators.append(check) + for target in check.target: + if not hasattr(target.name, 'validators'): + target.name.validators = [] + target.name.validators.append(check) diff --git a/src/rougail/annotator/condition.py b/src/rougail/annotator/condition.py index 2f22ac60..9391f97e 100644 --- a/src/rougail/annotator/condition.py +++ b/src/rougail/annotator/condition.py @@ -31,10 +31,13 @@ from ..i18n import _ from ..error import DictConsistencyError from ..config import Config +from .target import TargetAnnotator +from .param import ParamAnnotator + FREEZE_AUTOFREEZE_VARIABLE = 'module_instancie' -class ConditionAnnotator: +class ConditionAnnotator(TargetAnnotator, ParamAnnotator): """Annotate condition """ def __init__(self, @@ -47,7 +50,11 @@ class ConditionAnnotator: if not hasattr(objectspace.space, 'constraints') or \ not hasattr(self.objectspace.space.constraints, 'condition'): return - self.convert_condition_target() + self.target_is_uniq = False + self.only_variable = False + self.convert_target(self.objectspace.space.constraints.condition) + self.convert_param(self.objectspace.space.constraints.condition) + self.check_source_target() self.check_condition_fallback() self.convert_xxxlist() self.convert_condition_source() @@ -59,29 +66,6 @@ class ConditionAnnotator: """convert auto_freeze only if FREEZE_AUTOFREEZE_VARIABLE == 'oui' this variable is frozen """ - def _convert_auto_freeze(variable): - if not variable.auto_freeze: - return - if variable.namespace != Config['variable_namespace']: - xmlfiles = self.objectspace.display_xmlfiles(variable.xmlfiles) - msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}" in {xmlfiles}') - raise DictConsistencyError(msg, 49) - new_condition = self.objectspace.condition(variable.xmlfiles) - new_condition.name = 'auto_frozen_if_not_in' - new_condition.namespace = variable.namespace - new_condition.source = FREEZE_AUTOFREEZE_VARIABLE - new_param = self.objectspace.param(variable.xmlfiles) - new_param.text = 'oui' - new_condition.param = [new_param] - new_target = self.objectspace.target(variable.xmlfiles) - new_target.type = 'variable' - new_target.name = variable.name - 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) for variables in self.objectspace.space.variables.values(): for family in variables.family.values(): if not hasattr(family, 'variable'): @@ -89,50 +73,45 @@ class ConditionAnnotator: for variable in family.variable.values(): if isinstance(variable, self.objectspace.leadership): for follower in variable.variable: - _convert_auto_freeze(follower) + self._convert_auto_freeze(follower) else: - _convert_auto_freeze(variable) + self._convert_auto_freeze(variable) - def convert_condition_target(self): - """verify and manage target in condition + def _convert_auto_freeze(self, + variable: 'self.objectspace.variable', + ) -> None: + if not variable.auto_freeze: + return + if variable.namespace != Config['variable_namespace']: + msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"') + raise DictConsistencyError(msg, 49, variable.xmlfiles) + new_condition = self.objectspace.condition(variable.xmlfiles) + new_condition.name = 'auto_frozen_if_not_in' + new_condition.namespace = variable.namespace + new_condition.source = FREEZE_AUTOFREEZE_VARIABLE + new_param = self.objectspace.param(variable.xmlfiles) + new_param.text = 'oui' + new_condition.param = [new_param] + new_target = self.objectspace.target(variable.xmlfiles) + new_target.type = 'variable' + new_target.name = variable.name + 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) + + def check_source_target(self): + """verify that source != target in condition """ for condition in self.objectspace.space.constraints.condition: - if not hasattr(condition, 'target'): - xmlfiles = self.objectspace.display_xmlfiles(condition.xmlfiles) - msg = _(f'target is mandatory in a condition for source "{condition.source}" ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 9) - remove_targets = [] - for index, target in enumerate(condition.target): - try: - if target.type == 'variable': - if condition.source == target.name: - msg = _('target name and source name must be different: ' - f'{condition.source}') - raise DictConsistencyError(msg, 11) - target.name = self.objectspace.paths.get_variable(target.name) - elif target.type == 'family': - target.name = self.objectspace.paths.get_family(target.name, - condition.namespace, - ) - elif target.type.endswith('list') and \ - condition.name not in ['disabled_if_in', 'disabled_if_not_in']: - xmlfiles = self.objectspace.display_xmlfiles(target.xmlfiles) - msg = _(f'target "{target.type}" not allow in condition "{condition.name}" ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 10) - except DictConsistencyError as err: - if err.errno != 42: - raise err - # for optional variable - if not target.optional: - xmlfiles = self.objectspace.display_xmlfiles(condition.xmlfiles) - msg = f'cannot found target "{target.name}" in the condition in {xmlfiles}' - raise DictConsistencyError(_(msg), 12) from err - remove_targets.append(index) - remove_targets.sort(reverse=True) - for index in remove_targets: - condition.target.pop(index) + for target in condition.target: + if target.type == 'variable' and \ + condition.source in [target.name.name, target.name.path]: + msg = _('target name and source name must be different: ' + f'{condition.source}') + raise DictConsistencyError(msg, 11, condition.xmlfiles) def check_condition_fallback(self): """a condition with a fallback **and** the source variable doesn't exist @@ -140,17 +119,16 @@ class ConditionAnnotator: remove_conditions = [] for idx, condition in enumerate(self.objectspace.space.constraints.condition): # fallback - if condition.fallback is True and \ - not self.objectspace.paths.path_is_defined(condition.source): - apply_action = False - if condition.name in ['disabled_if_in', 'mandatory_if_in', 'hidden_if_in']: - apply_action = not condition.force_condition_on_fallback - else: - apply_action = condition.force_inverse_condition_on_fallback - remove_conditions.append(idx) - if apply_action: - self.force_actions_to_variable(condition) - remove_conditions = list(set(remove_conditions)) + if condition.fallback is False or \ + self.objectspace.paths.path_is_defined(condition.source): + continue + if condition.name in ['disabled_if_in', 'mandatory_if_in', 'hidden_if_in']: + apply_action = not condition.force_condition_on_fallback + else: + apply_action = condition.force_inverse_condition_on_fallback + remove_conditions.append(idx) + if apply_action: + self.force_actions_to_variable(condition) remove_conditions.sort(reverse=True) for idx in remove_conditions: self.objectspace.space.constraints.condition.pop(idx) @@ -234,7 +212,6 @@ class ConditionAnnotator: if target.name in self.force_service_value: listvar.default = self.force_service_value[target.name] continue - value = condition.name != 'disabled_if_in' if listvar.path in fills: fill = fills[listvar.path] or_needed = True @@ -246,7 +223,9 @@ class ConditionAnnotator: fill.index += 1 else: fill = self.objectspace.fill(target.xmlfiles) - fill.target = listvar.path + new_target = self.objectspace.target(target.xmlfiles) + new_target.name = listvar.path + fill.target = [new_target] fill.name = 'calc_value' fill.namespace = 'services' fill.index = 0 @@ -284,7 +263,7 @@ class ConditionAnnotator: fill.param.append(param5) if or_needed: param6 = self.objectspace.param(target.xmlfiles) - param6.name = f'condition_operator' + param6.name = 'condition_operator' param6.text = 'OR' fill.param.append(param6) @@ -296,15 +275,12 @@ class ConditionAnnotator: condition.source = self.objectspace.paths.get_variable(condition.source) except DictConsistencyError as err: if err.errno == 36: - xmlfiles = self.objectspace.display_xmlfiles(condition.xmlfiles) msg = _(f'the source "{condition.source}" in condition cannot be a dynamic ' - f'variable in {xmlfiles}') - raise DictConsistencyError(msg, 20) from err + f'variable') + raise DictConsistencyError(msg, 20, condition.xmlfiles) from err if err.errno == 42: - xmlfiles = self.objectspace.display_xmlfiles(condition.xmlfiles) - msg = _(f'the source "{condition.source}" in condition is an unknown variable ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 23) from err + msg = _(f'the source "{condition.source}" in condition is an unknown variable') + raise DictConsistencyError(msg, 23, condition.xmlfiles) from err raise err from err # pragma: no cover def check_choice_option_condition(self): diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index caa897d3..f4c29857 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -138,13 +138,11 @@ class FamilyAnnotator: leader_mode = None for follower in leadership.variable: if follower.auto_save is True: - xmlfiles = self.objectspace.display_xmlfiles(leadership.xmlfiles) - msg = _(f'leader/followers "{follower.name}" could not be auto_save in {xmlfiles}') - raise DictConsistencyError(msg, 29) + msg = _(f'leader/followers "{follower.name}" could not be auto_save') + raise DictConsistencyError(msg, 29, leadership.xmlfiles) if follower.auto_freeze is True: - xmlfiles = self.objectspace.display_xmlfiles(leadership.xmlfiles) - msg = f'leader/followers "{follower.name}" could not be auto_freeze in {xmlfiles}' - raise DictConsistencyError(_(msg), 30) + msg = f'leader/followers "{follower.name}" could not be auto_freeze' + raise DictConsistencyError(_(msg), 30, leadership.xmlfiles) self._change_variabe_mode(follower, family_mode, is_follower, @@ -169,10 +167,9 @@ class FamilyAnnotator: family.suffixes = self.objectspace.paths.get_variable(family.dynamic) del family.dynamic if not family.suffixes.multi: - xmlfiles = self.objectspace.display_xmlfiles(family.xmlfiles) msg = _(f'dynamic family "{family.name}" must be linked ' - f'to multi variable in {xmlfiles}') - raise DictConsistencyError(msg, 16) + f'to multi variable') + raise DictConsistencyError(msg, 16, family.xmlfiles) def convert_help(self): """Convert variable help diff --git a/src/rougail/annotator/fill.py b/src/rougail/annotator/fill.py index 8480b7bd..356c38d3 100644 --- a/src/rougail/annotator/fill.py +++ b/src/rougail/annotator/fill.py @@ -28,8 +28,11 @@ from ..utils import load_modules from ..i18n import _ from ..error import DictConsistencyError +from .target import TargetAnnotator +from .param import ParamAnnotator -class FillAnnotator: + +class FillAnnotator(TargetAnnotator, ParamAnnotator): """Fill annotator """ def __init__(self, @@ -41,97 +44,32 @@ class FillAnnotator: not hasattr(self.objectspace.space.constraints, 'fill'): return self.functions = dir(load_modules(eosfunc_file)) - self.convert_fill() + self.target_is_uniq = True + self.only_variable = True + 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 - def convert_fill(self) -> None: + def fill_to_value(self) -> None: """valid and manage """ - targets = [] for fill in self.objectspace.space.constraints.fill: - # test if it's redefined calculation - if fill.target in targets: - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _(f'A fill already exists for the target of "{fill.target}" created ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 24) - targets.append(fill.target) + for target in fill.target: + # test if the function exists + if fill.name not in self.functions: + msg = _(f'cannot find fill function "{fill.name}"') + raise DictConsistencyError(msg, 25, fill.xmlfiles) - # test if the function exists - if fill.name not in self.functions: - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _(f'cannot find fill function "{fill.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 25) + # create an object value + value = self.objectspace.value(fill.xmlfiles) + value.type = 'calculation' + value.name = fill.name + if target.name.namespace == 'services': + target.name.default = value + else: + target.name.value = [value] - # let's replace the target by the path - fill.target, suffix = self.objectspace.paths.get_variable_path(fill.target, - fill.namespace, - ) - if suffix is not None: - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _(f'Cannot add fill function to "{fill.target}" only ' - f'for the suffix "{suffix}" in {xmlfiles}') - raise DictConsistencyError(msg, 26) - - # get the target variable - variable = self.objectspace.paths.get_variable(fill.target) - - # create an object value - value = self.objectspace.value(fill.xmlfiles) - value.type = 'calculation' - value.name = fill.name - if variable.namespace == 'services': - variable.default = value - else: - variable.value = [value] - - # manage params - if not hasattr(fill, 'param'): - continue - self.convert_fill_param(fill) - if fill.param: - value.param = fill.param - - def convert_fill_param(self, - fill: "self.objectspace.fill", - ) -> None: - """ valid and convert fill's param - """ - param_to_delete = [] - for param_idx, param in enumerate(fill.param): - if param.type == 'string' and not hasattr(param, 'text'): - param.text = None - if param.type == 'suffix': - if hasattr(param, 'text'): - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _(f'"{param.type}" variables must not have a value in order ' - f'to calculate "{fill.target}" in {xmlfiles}') - raise DictConsistencyError(msg, 28) - if not self.objectspace.paths.variable_is_dynamic(fill.target): - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _('Cannot set suffix target to the none dynamic variable ' - f'"{fill.target}" in {xmlfiles}') - raise DictConsistencyError(msg, 53) - elif not hasattr(param, 'text'): - xmlfiles = self.objectspace.display_xmlfiles(fill.xmlfiles) - msg = _(f'All "{param.type}" variables must have a value in order ' - f'to calculate "{fill.target}" in {xmlfiles}') - raise DictConsistencyError(msg, 27) - if param.type == 'variable': - try: - path, suffix = self.objectspace.paths.get_variable_path(param.text, - fill.namespace, - ) - param.text = self.objectspace.paths.get_variable(path) - if suffix: - param.suffix = suffix - family_path = self.objectspace.paths.get_variable_family_path(path) - param.family = self.objectspace.paths.get_family(family_path, - param.text.namespace, - ) - except DictConsistencyError as err: - if err.errno != 42 or not param.optional: - raise err - param_to_delete.append(param_idx) - param_to_delete.sort(reverse=True) - for param_idx in param_to_delete: - fill.param.pop(param_idx) + # manage params + if hasattr(fill, 'param') and fill.param: + value.param = fill.param diff --git a/src/rougail/annotator/group.py b/src/rougail/annotator/group.py index f611591f..84833c62 100644 --- a/src/rougail/annotator/group.py +++ b/src/rougail/annotator/group.py @@ -83,11 +83,9 @@ class GroupAnnotator: # no more follower break else: - xmlfiles = self.objectspace.display_xmlfiles(variable.xmlfiles) joined = '", "'.join(follower_names) - msg = _(f'when parsing leadership, we espect to find those followers "{joined}" ' - f'in {xmlfiles}') - raise DictConsistencyError(msg, 31) + msg = _(f'when parsing leadership, we espect to find those followers "{joined}"') + raise DictConsistencyError(msg, 31, variable.xmlfiles) del self.objectspace.space.constraints.group def manage_leader(self, @@ -98,9 +96,8 @@ class GroupAnnotator: """manage leader's variable """ if variable.multi is not True: - xmlfiles = self.objectspace.display_xmlfiles(variable.xmlfiles) - msg = _(f'the variable "{variable.name}" in a group must be multi in {xmlfiles}') - raise DictConsistencyError(msg, 32) + msg = _(f'the variable "{variable.name}" in a group must be multi') + raise DictConsistencyError(msg, 32, variable.xmlfiles) if hasattr(group, 'name'): leadership_name = group.name else: @@ -145,10 +142,9 @@ class GroupAnnotator: """manage follower """ if variable.name != follower_name: - xmlfiles = self.objectspace.display_xmlfiles(variable.xmlfiles) msg = _('when parsing leadership, we expect to find the follower ' - f'"{follower_name}" but we found "{variable.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 33) + f'"{follower_name}" but we found "{variable.name}"') + raise DictConsistencyError(msg, 33, variable.xmlfiles) self.objectspace.paths.set_leader(variable.namespace, leader_family_name, leader_space.name, diff --git a/src/rougail/annotator/param.py b/src/rougail/annotator/param.py new file mode 100644 index 00000000..079f6082 --- /dev/null +++ b/src/rougail/annotator/param.py @@ -0,0 +1,74 @@ +"""Param annotator + +Created by: +EOLE (http://eole.orion.education.fr) +Copyright (C) 2005-2018 + +Forked by: +Cadoles (http://www.cadoles.com) +Copyright (C) 2019-2021 + +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 ..i18n import _ +from ..error import DictConsistencyError + + +class ParamAnnotator: + def convert_param(self, objects) -> None: + """ valid and convert param + """ + for obj in objects: + if not hasattr(obj, 'param'): + continue + param_to_delete = [] + for param_idx, param in enumerate(obj.param): + if param.type == 'suffix': + if hasattr(param, 'text'): + msg = _(f'"{param.type}" parameter must not have a value') + raise DictConsistencyError(msg, 28, obj.xmlfiles) + for target in obj.target: + if not self.objectspace.paths.variable_is_dynamic(target.name.path): + msg = _(f'"suffix" parameter cannot be set with target "{target.name}"' + f' which is not a dynamic variable') + raise DictConsistencyError(msg, 53, obj.xmlfiles) + elif not hasattr(param, 'text'): + if not param.type == 'nil': + msg = _(f'"{param.type}" parameter must have a value') + raise DictConsistencyError(msg, 27, obj.xmlfiles) + elif param.type == 'nil': + msg = _(f'"{param.type}" parameter must not have a value') + raise DictConsistencyError(msg, 40, obj.xmlfiles) + if param.type == 'variable': + try: + path, suffix = self.objectspace.paths.get_variable_path(param.text, + obj.namespace, + ) + param.text = self.objectspace.paths.get_variable(path) + if suffix: + param.suffix = suffix + family_path = self.objectspace.paths.get_variable_family_path(path) + param.family = self.objectspace.paths.get_family(family_path, + param.text.namespace, + ) + except DictConsistencyError as err: + if err.errno != 42 or not param.optional: + raise err + param_to_delete.append(param_idx) + param_to_delete.sort(reverse=True) + for param_idx in param_to_delete: + obj.param.pop(param_idx) diff --git a/src/rougail/annotator/property.py b/src/rougail/annotator/property.py index 9a082adc..5e2d2115 100644 --- a/src/rougail/annotator/property.py +++ b/src/rougail/annotator/property.py @@ -71,10 +71,9 @@ class PropertyAnnotator: if 'force_store_value' in variable.properties and \ 'force_default_on_freeze' in variable.properties: # pragma: no cover # should not appened - xmlfiles = self.objectspace.display_xmlfiles(variable.xmlfiles) msg = _('cannot have auto_freeze or auto_store with the hidden ' - f'variable "{variable.name}" in {xmlfiles}') - raise DictConsistencyError(msg, 50) + f'variable "{variable.name}"') + raise DictConsistencyError(msg, 50, variable.xmlfiles) if not variable.properties: del variable.properties diff --git a/src/rougail/annotator/service.py b/src/rougail/annotator/service.py index 3c909492..00fb310a 100644 --- a/src/rougail/annotator/service.py +++ b/src/rougail/annotator/service.py @@ -33,7 +33,7 @@ from ..error import DictConsistencyError # a CreoleObjSpace's attribute has some annotations # that shall not be present in the exported (flatened) XML ERASED_ATTRIBUTES = ('redefine', 'exists', 'fallback', 'optional', 'remove_check', 'namespace', - 'remove_condition', 'path', 'instance_mode', 'index', 'is_in_leadership', + 'remove_condition', 'path', 'instance_mode', 'index', 'level', 'remove_fill', 'xmlfiles', 'type', 'reflector_name', 'reflector_object', 'manage') @@ -252,7 +252,6 @@ class ServiceAnnotator: if not hasattr(file_, 'source'): file_.source = basename(file_.name) elif not hasattr(file_, 'source'): - xmlfiles = self.objectspace.display_xmlfiles(file_.xmlfiles) msg = _(f'attribute "source" is mandatory for the file "{file_.name}" ' - f'"({service_name})" in {xmlfiles}') - raise DictConsistencyError(msg, 34) + f'"({service_name})"') + raise DictConsistencyError(msg, 34, file_.xmlfiles) diff --git a/src/rougail/annotator/target.py b/src/rougail/annotator/target.py new file mode 100644 index 00000000..2e68c052 --- /dev/null +++ b/src/rougail/annotator/target.py @@ -0,0 +1,82 @@ +"""Target annotator + +Created by: +EOLE (http://eole.orion.education.fr) +Copyright (C) 2005-2018 + +Forked by: +Cadoles (http://www.cadoles.com) +Copyright (C) 2019-2021 + +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 ..i18n import _ +from ..error import DictConsistencyError + + +class TargetAnnotator: + def convert_target(self, + objects, + ) -> None: + """ valid and convert param + """ + targets = [] + for obj in objects: + if not hasattr(obj, 'target'): + msg = _('target is mandatory') + raise DictConsistencyError(msg, 9, obj.xmlfiles) + remove_targets = [] + for index, target in enumerate(obj.target): + # test if it's redefined calculation + if self.target_is_uniq and target.name in targets: + msg = _(f'A fill already exists for the target of "{target.name}" created') + raise DictConsistencyError(msg, 24, obj.xmlfiles) + targets.append(target.name) + + # 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) + elif self.only_variable: + msg = _(f'target to "{target.name}" with param type "{target.type}" ' + f'is not allowed') + raise DictConsistencyError(msg, 2, obj.xmlfiles) + if target.type == 'family': + target.name = self.objectspace.paths.get_family(target.name, + obj.namespace, + ) + elif target.type.endswith('list') and \ + obj.name not in ['disabled_if_in', 'disabled_if_not_in']: + msg = _(f'target "{target.type}" not allow') + raise DictConsistencyError(msg, 10, target.xmlfiles) + except DictConsistencyError as err: + if err.errno != 42: + raise err + # for optional variable + if not target.optional: + msg = f'cannot found target "{target.name}"' + raise DictConsistencyError(_(msg), 12, target.xmlfiles) from err + remove_targets.append(index) + remove_targets.sort(reverse=True) + for index in remove_targets: + obj.target.pop(index) diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index 3a2d0353..505b8e45 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -147,7 +147,9 @@ class VariableAnnotator: # pylint: disable=R0903 self.objectspace.space.constraints.check = [] check = self.objectspace.check(variable.xmlfiles) check.name = 'valid_enum' - check.target = variable.path + target = self.objectspace.target(variable.xmlfiles) + target.name = variable.path + check.target = [target] check.namespace = namespace check.param = [] for value in FORCE_CHOICE[variable.type]: diff --git a/src/rougail/data/rougail.dtd b/src/rougail/data/rougail.dtd index bc694394..8cf5a2d4 100644 --- a/src/rougail/data/rougail.dtd +++ b/src/rougail/data/rougail.dtd @@ -112,16 +112,14 @@ - + - - + - - + @@ -129,7 +127,7 @@ - + diff --git a/src/rougail/error.py b/src/rougail/error.py index 59a360de..68cd61a7 100644 --- a/src/rougail/error.py +++ b/src/rougail/error.py @@ -24,6 +24,17 @@ 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 .i18n import _ + + +def display_xmlfiles(xmlfiles: list) -> str: + """The function format xmlfiles informations to generate errors + """ + if len(xmlfiles) == 1: + return '"' + xmlfiles[0] + '"' + return '"' + '", "'.join(xmlfiles[:-1]) + '"' + ' and ' + '"' + xmlfiles[-1] + '"' + + class ConfigError(Exception): """Standard error for templating """ @@ -54,6 +65,8 @@ class DictConsistencyError(Exception): """It's not only that the Creole XML is valid against the Creole DTD it's that it is not consistent. """ - def __init__(self, msg, errno): + def __init__(self, msg, errno, xmlfiles): + if xmlfiles: + msg = _(f'{msg} in {display_xmlfiles(xmlfiles)}') super().__init__(msg) self.errno = errno diff --git a/src/rougail/objspace.py b/src/rougail/objspace.py index 664a3e67..d915c874 100644 --- a/src/rougail/objspace.py +++ b/src/rougail/objspace.py @@ -149,14 +149,6 @@ class RougailObjSpace: name = name[:-1] return name - @staticmethod - def display_xmlfiles(xmlfiles: list) -> str: - """The function format xmlfiles informations to generate errors - """ - if len(xmlfiles) == 1: - return '"' + xmlfiles[0] + '"' - return '"' + '", "'.join(xmlfiles[:-1]) + '"' + ' and ' + '"' + xmlfiles[-1] + '"' - def xml_parse_document(self, xmlfile, document, @@ -166,8 +158,8 @@ class RougailObjSpace: """Parses a Rougail XML file and populates the RougailObjSpace """ if namespace in ['services', Config['variable_namespace']]: - msg = _(f'Namespace name "{namespace}" is not allowed in "{xmlfile}"') - raise DictConsistencyError(msg, 21) + msg = _(f'Namespace name "{namespace}" is not allowed') + raise DictConsistencyError(msg, 21, xmlfile) if not namespace: namespace = Config['variable_namespace'] redefine_variables = [] @@ -193,8 +185,8 @@ class RougailObjSpace: continue if child.tag == 'family': if child.attrib['name'] in family_names: - msg = _(f'Family "{child.attrib["name"]}" is set several times in "{xmlfile}"') - raise DictConsistencyError(msg, 44) + msg = _(f'Family "{child.attrib["name"]}" is set several times') + raise DictConsistencyError(msg, 44, xmlfile) family_names.append(child.attrib['name']) try: # variable objects creation @@ -309,10 +301,9 @@ class RougailObjSpace: exists = self.convert_boolean(subspace.get('exists', True)) if exists is False: raise SpaceObjShallNotBeUpdated() - xmlfiles = self.display_xmlfiles(existed_var.xmlfiles) msg = _(f'"{child.tag}" named "{name}" cannot be re-created in "{xmlfile}", ' - f'already defined in {xmlfiles}') - raise DictConsistencyError(msg, 45) + f'already defined') + raise DictConsistencyError(msg, 45, existed_var.xmlfiles) # object deos not exists exists = self.convert_boolean(subspace.get('exists', False)) if exists is True: @@ -321,8 +312,8 @@ class RougailObjSpace: redefine = self.convert_boolean(subspace.get('redefine', False)) if redefine is True: # cannot redefine an inexistant object - msg = _(f'Redefined object in "{xmlfile}": "{name}" does not exist yet') - raise DictConsistencyError(msg, 46) + msg = _(f'Redefined object: "{name}" does not exist yet') + raise DictConsistencyError(msg, 46, xmlfile) if child.tag not in vars(space): setattr(space, child.tag, {}) return getattr(self, child.tag)(xmlfile, name) @@ -344,10 +335,9 @@ class RougailObjSpace: return None old_family_name = self.paths.get_variable_family_path(name) if space.path != old_family_name: - xmlfiles = self.display_xmlfiles(space.xmlfiles) msg = _(f'Variable was previously create in family "{old_family_name}", ' - f'now it is in "{space.path}" in {xmlfiles}') - raise DictConsistencyError(msg, 47) + f'now it is in "{space.path}"') + raise DictConsistencyError(msg, 47, space.xmlfiles) return self.paths.get_variable(name) # it's not a family children = getattr(space, child.tag, {}) @@ -392,10 +382,9 @@ class RougailObjSpace: del variableobj.value for attr, val in child.attrib.items(): if redefine and attr in UNREDEFINABLE: - xmlfiles = self.display_xmlfiles(variableobj.xmlfiles[:-1]) msg = _(f'cannot redefine attribute "{attr}" for variable "{child.attrib["name"]}"' - f' in "{xmlfile}", already defined in {xmlfiles}') - raise DictConsistencyError(msg, 48) + f' in "{xmlfile}", already defined') + raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1]) if attr in self.booleans_attributs: val = self.convert_boolean(val) if attr == 'name' and getattr(variableobj, 'name', None): @@ -417,16 +406,19 @@ class RougailObjSpace: self.remove_condition(variableobj.name) if child.attrib.get('remove_fill', False): self.remove_fill(variableobj.name) - if child.tag == 'fill' and child.attrib['target'] in redefine_variables: - self.remove_fill(child.attrib['target']) + if child.tag == 'fill': + for target in child: + if target.tag == 'target' and target.text in redefine_variables: + self.remove_fill(target.text) def remove_check(self, name): """Remove a check with a specified target """ remove_checks = [] for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101 - if check.target == name: - remove_checks.append(idx) + 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 @@ -451,8 +443,9 @@ class RougailObjSpace: """ remove_fills = [] for idx, fill in enumerate(self.space.constraints.fill): # pylint: disable=E1101 - if fill.target == name: - remove_fills.append(idx) + 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 diff --git a/src/rougail/path.py b/src/rougail/path.py index 233825bc..b0f2f96e 100644 --- a/src/rougail/path.py +++ b/src/rougail/path.py @@ -56,11 +56,11 @@ class Path: else: if '.' not in name: # pragma: no cover msg = _(f'Variable "{name}" in namespace "{namespace}" must have dot') - raise DictConsistencyError(msg, 39) + 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 - raise DictConsistencyError(_(f'Duplicate family name "{name}"'), 37) + raise DictConsistencyError(_(f'Duplicate family name "{name}"'), 37, variableobj.xmlfiles) self.families[full_name] = dict(name=name, namespace=namespace, variableobj=variableobj, @@ -90,13 +90,13 @@ class Path: 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(_('unknown option {}').format(name), 42) + raise DictConsistencyError(_(f'unknown option {name}'), 42, []) dico = self.families[name] if current_namespace not in [Config['variable_namespace'], 'services'] and \ current_namespace != dico['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) + raise DictConsistencyError(msg, 38, []) return dico['variableobj'] # Leadership @@ -119,11 +119,6 @@ class Path: if namespace == Config['variable_namespace']: self.full_paths_variables[name] = new_path - def is_in_leadership(self, name): - """Is the variable is in a leadership - """ - return self._get_variable(name)['leader'] is not None - def is_leader(self, path): # pylint: disable=C0111 """Is the variable is a leader """ @@ -164,7 +159,7 @@ class Path: """ variable, suffix = self._get_variable(name, with_suffix=True) if suffix: - raise DictConsistencyError(_(f"{name} is a dynamic variable"), 36) + raise DictConsistencyError(_(f"{name} is a dynamic variable"), 36, []) return variable['variableobj'] def get_variable_family_path(self, @@ -188,7 +183,7 @@ class Path: current_namespace != namespace: msg = _(f'A variable located in the "{namespace}" namespace shall not be used ' f'in the "{current_namespace}" namespace') - raise DictConsistencyError(msg, 41) + raise DictConsistencyError(msg, 41, []) return dico['variableobj'].path, suffix def path_is_defined(self, @@ -222,7 +217,7 @@ class Path: if variable['is_dynamic']: return variable, name[len(var_name):] if name not in self.variables: - raise DictConsistencyError(_('unknown option {}').format(name), 42) + raise DictConsistencyError(_(f'unknown option {name}'), 42, []) if with_suffix: return self.variables[name], None return self.variables[name] diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 5ba1d784..140375ef 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -203,21 +203,31 @@ class Common: ) -> None: """Change properties to string """ - properties = [self.convert_str(property_) for property_ in values if isinstance(property_, str)] + properties = [self.convert_str(property_) for property_ in values + if isinstance(property_, str)] calc_properties = [self.calc_properties(property_) for property_ in values \ if isinstance(property_, self.objectspace.property_)] return 'frozenset({' + ', '.join(sorted(properties) + calc_properties) + '})' - @staticmethod - def calc_properties(child) -> str: + def calc_properties(self, + child, + ) -> str: """Populate properties """ option_name = child.source.reflector_object.get() - kwargs = (f"'condition': ParamOption({option_name}, todict=True), " - f"'expected': ParamValue('{child.expected}')") + kwargs = f"'condition': ParamOption({option_name}, todict=True), " + if child.expected is None or isinstance(child.expected, int): + kwargs += f"'expected': ParamValue({child.expected})" + elif isinstance(child.expected, str): + val = self.convert_str(child.expected) + kwargs += f"'expected': ParamValue({val})" + else: + val = child.expected.reflector_object.get() + kwargs += f"'expected': ParamOption({val})" if child.inverse: kwargs += ", 'reverse_condition': ParamValue(True)" - return f"Calculation(func.calc_value, Params(ParamValue('{child.name}'), kwargs={{{kwargs}}}))" + return (f"Calculation(func.calc_value, Params(ParamValue('{child.name}'), " + f"kwargs={{{kwargs}}}))") def populate_informations(self): """Populate Tiramisu's informations @@ -313,6 +323,8 @@ class Variable(Common): return f"ParamValue({value})" if param.type in ['number', 'boolean']: return f'ParamValue({param.text})' + if param.type == 'nil': + return 'ParamValue(None)' if param.type == 'variable': return self.build_param(param, function) if param.type == 'information': @@ -323,7 +335,7 @@ class Variable(Common): @staticmethod def build_param(param, - function: str, + function: str, # pylint: disable=W0613 ) -> str: """build variable parameters """ diff --git a/src/rougail/xmlreflector.py b/src/rougail/xmlreflector.py index 1beee9ce..698c7627 100644 --- a/src/rougail/xmlreflector.py +++ b/src/rougail/xmlreflector.py @@ -62,11 +62,11 @@ class XMLReflector: try: document = parse(xmlfile) except XMLSyntaxError as err: - raise DictConsistencyError(_(f'{xmlfile} is not an XML file: {err}'), 52) from err + raise DictConsistencyError(_(f'not an XML file: {err}'), 52, xmlfile) from err if not self.dtd.validate(document): dtd_error = self.dtd.error_log.filter_from_errors()[0] - msg = _(f'"{xmlfile}" not a valid XML file: {dtd_error}') - raise DictConsistencyError(msg, 43) + msg = _(f'not a valid XML file: {dtd_error}') + raise DictConsistencyError(msg, 43, xmlfile) return document.getroot() @staticmethod diff --git a/tests/dictionaries/00load_autofreeze/tiramisu/base.py b/tests/dictionaries/00load_autofreeze/tiramisu/base.py index 55f1880d..057d06c1 100644 --- a/tests/dictionaries/00load_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/00load_autofreeze/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_2 = OptionDescription(name="general", doc="général", 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]) diff --git a/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py b/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py index 02372658..561b0707 100644 --- a/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py +++ b/tests/dictionaries/00load_autofreezeexpert/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) -option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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]) diff --git a/tests/dictionaries/01auto_autofreeze/00-base.xml b/tests/dictionaries/01auto_autofreeze/00-base.xml index a46d30df..1cee6e10 100644 --- a/tests/dictionaries/01auto_autofreeze/00-base.xml +++ b/tests/dictionaries/01auto_autofreeze/00-base.xml @@ -11,8 +11,9 @@ - + oui + mode_conteneur_actif diff --git a/tests/dictionaries/01auto_autofreeze/tiramisu/base.py b/tests/dictionaries/01auto_autofreeze/tiramisu/base.py index 6ebbca2d..b53d674f 100644 --- a/tests/dictionaries/01auto_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01auto_autofreeze/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_3 = StrOption(name="module_instancie", 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("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", "frozen", "hidden", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", "frozen", "hidden", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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]) diff --git a/tests/dictionaries/01auto_base/00-base.xml b/tests/dictionaries/01auto_base/00-base.xml index 0f02345e..b049228f 100644 --- a/tests/dictionaries/01auto_base/00-base.xml +++ b/tests/dictionaries/01auto_base/00-base.xml @@ -12,8 +12,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01auto_withoutparam/00-base.xml b/tests/dictionaries/01auto_withoutparam/00-base.xml index fa9c8f7b..f700d753 100644 --- a/tests/dictionaries/01auto_withoutparam/00-base.xml +++ b/tests/dictionaries/01auto_withoutparam/00-base.xml @@ -12,7 +12,8 @@ - + + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_autofreeze/00-base.xml b/tests/dictionaries/01fill_autofreeze/00-base.xml index d88573f7..4cb6b371 100644 --- a/tests/dictionaries/01fill_autofreeze/00-base.xml +++ b/tests/dictionaries/01fill_autofreeze/00-base.xml @@ -15,8 +15,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_autofreeze/tiramisu/base.py b/tests/dictionaries/01fill_autofreeze/tiramisu/base.py index 1604838a..1f388973 100644 --- a/tests/dictionaries/01fill_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01fill_autofreeze/tiramisu/base.py @@ -14,7 +14,7 @@ except: from rougail.tiramisu import ConvertDynOptionDescription option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_5 = StrOption(name="module_instancie", 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({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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]) diff --git a/tests/dictionaries/01fill_autosave/00-base.xml b/tests/dictionaries/01fill_autosave/00-base.xml index 6cc494ad..e7f8557e 100644 --- a/tests/dictionaries/01fill_autosave/00-base.xml +++ b/tests/dictionaries/01fill_autosave/00-base.xml @@ -12,8 +12,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_base/00-base.xml b/tests/dictionaries/01fill_base/00-base.xml index c1af0f02..7f777ad0 100644 --- a/tests/dictionaries/01fill_base/00-base.xml +++ b/tests/dictionaries/01fill_base/00-base.xml @@ -10,8 +10,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_baseaccent/00-base.xml b/tests/dictionaries/01fill_baseaccent/00-base.xml index ce8bd9f0..113c5478 100644 --- a/tests/dictionaries/01fill_baseaccent/00-base.xml +++ b/tests/dictionaries/01fill_baseaccent/00-base.xml @@ -12,8 +12,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_mandatory/00-base.xml b/tests/dictionaries/01fill_mandatory/00-base.xml index 1573e3cf..99cd039b 100644 --- a/tests/dictionaries/01fill_mandatory/00-base.xml +++ b/tests/dictionaries/01fill_mandatory/00-base.xml @@ -10,8 +10,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_number/00-base.xml b/tests/dictionaries/01fill_number/00-base.xml index b42adf82..2407da8c 100644 --- a/tests/dictionaries/01fill_number/00-base.xml +++ b/tests/dictionaries/01fill_number/00-base.xml @@ -10,8 +10,9 @@ - + 3 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_only_optional/00-base.xml b/tests/dictionaries/01fill_only_optional/00-base.xml index b3b24923..a96d2757 100644 --- a/tests/dictionaries/01fill_only_optional/00-base.xml +++ b/tests/dictionaries/01fill_only_optional/00-base.xml @@ -12,8 +12,9 @@ - + mode_conteneur_actif4 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_optional/00-base.xml b/tests/dictionaries/01fill_optional/00-base.xml index f59abcab..d17069a7 100644 --- a/tests/dictionaries/01fill_optional/00-base.xml +++ b/tests/dictionaries/01fill_optional/00-base.xml @@ -12,10 +12,11 @@ - + mode_conteneur_actif4 mode_conteneur_actif1 mode_conteneur_actif3 + mode_conteneur_actif diff --git a/tests/dictionaries/01fill_quote/00-base.xml b/tests/dictionaries/01fill_quote/00-base.xml index 381d64da..173afe26 100644 --- a/tests/dictionaries/01fill_quote/00-base.xml +++ b/tests/dictionaries/01fill_quote/00-base.xml @@ -10,17 +10,21 @@ - + quote' + mode_conteneur_actif - + quote" + mode_conteneur_actif1 - + quote"' + mode_conteneur_actif2 - + quote"\' + mode_conteneur_actif3 diff --git a/tests/dictionaries/01hidden_if_in_autofreeze/00-base.xml b/tests/dictionaries/01hidden_if_in_autofreeze/00-base.xml index 233399af..270fdf2e 100644 --- a/tests/dictionaries/01hidden_if_in_autofreeze/00-base.xml +++ b/tests/dictionaries/01hidden_if_in_autofreeze/00-base.xml @@ -11,8 +11,9 @@ - + oui + mode_conteneur_actif oui diff --git a/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py index 49bc4bc5..0efa3a90 100644 --- a/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py +++ b/tests/dictionaries/01hidden_if_in_autofreeze/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_3 = StrOption(name="module_instancie", 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("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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]) diff --git a/tests/dictionaries/02autosave_hidden_frozenifin/00-base.xml b/tests/dictionaries/02autosave_hidden_frozenifin/00-base.xml index 2961ee33..9b73bdb7 100644 --- a/tests/dictionaries/02autosave_hidden_frozenifin/00-base.xml +++ b/tests/dictionaries/02autosave_hidden_frozenifin/00-base.xml @@ -9,8 +9,9 @@ - + oui + autosavevar oui diff --git a/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py index 7fe23bdd..419b2527 100644 --- a/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py +++ b/tests/dictionaries/02autosave_hidden_frozenifin/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")}))})) option_2 = OptionDescription(name="general", doc="général", 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]) diff --git a/tests/dictionaries/10autosave_hidden/00-base.xml b/tests/dictionaries/10autosave_hidden/00-base.xml index 64e97ce1..e2653fdc 100644 --- a/tests/dictionaries/10autosave_hidden/00-base.xml +++ b/tests/dictionaries/10autosave_hidden/00-base.xml @@ -10,8 +10,9 @@ - + oui + autosavevar diff --git a/tests/dictionaries/10check_base/00-base.xml b/tests/dictionaries/10check_base/00-base.xml index 69c8fede..63b9e332 100644 --- a/tests/dictionaries/10check_base/00-base.xml +++ b/tests/dictionaries/10check_base/00-base.xml @@ -9,9 +9,10 @@ - + 0 100 + int diff --git a/tests/dictionaries/10check_no_param/00-base.xml b/tests/dictionaries/10check_no_param/00-base.xml index f2d3626a..207cea76 100644 --- a/tests/dictionaries/10check_no_param/00-base.xml +++ b/tests/dictionaries/10check_no_param/00-base.xml @@ -10,7 +10,9 @@ - + + int + diff --git a/tests/dictionaries/60extra_externalspace/__init__.py b/tests/dictionaries/10load_disabled_if_in_variable/__init__.py similarity index 100% rename from tests/dictionaries/60extra_externalspace/__init__.py rename to tests/dictionaries/10load_disabled_if_in_variable/__init__.py diff --git a/tests/dictionaries/10load_disabled_if_in_variable/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_variable/makedict/base.json new file mode 100644 index 00000000..6c66feb5 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable/makedict/base.json @@ -0,0 +1 @@ +{"rougail.general.condition": "tous", "rougail.general.mode_conteneur_actif": "tous"} diff --git a/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py new file mode 100644 index 00000000..d4e091e9 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable/tiramisu/base.py @@ -0,0 +1,20 @@ +from importlib.machinery import SourceFileLoader +from importlib.util import spec_from_loader, module_from_spec +loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') +spec = spec_from_loader(loader.name, loader) +func = module_from_spec(spec) +loader.exec_module(func) +for key, value in dict(locals()).items(): + if key != ['SourceFileLoader', 'func']: + setattr(func, key, value) +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +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), '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]) diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/00-base.xml b/tests/dictionaries/10load_disabled_if_in_variable2/00-base.xml new file mode 100644 index 00000000..726c5fb1 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable2/00-base.xml @@ -0,0 +1,34 @@ + + + + + + + + tous + + + aucun + + + non + + + + + + + tous + authentifié + aucun + condition + + + mode_conteneur_actif + mode_conteneur_actif2 + + + + + diff --git a/tests/dictionaries/60extra_externalspace/errno_41 b/tests/dictionaries/10load_disabled_if_in_variable2/__init__.py similarity index 100% rename from tests/dictionaries/60extra_externalspace/errno_41 rename to tests/dictionaries/10load_disabled_if_in_variable2/__init__.py diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_variable2/makedict/base.json new file mode 100644 index 00000000..fb7866b3 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable2/makedict/base.json @@ -0,0 +1 @@ +{"rougail.general.condition": "tous", "rougail.general.mode_conteneur_actif": "aucun", "rougail.general.mode_conteneur_actif2": "non"} diff --git a/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py new file mode 100644 index 00000000..8c174a44 --- /dev/null +++ b/tests/dictionaries/10load_disabled_if_in_variable2/tiramisu/base.py @@ -0,0 +1,20 @@ +from importlib.machinery import SourceFileLoader +from importlib.util import spec_from_loader, module_from_spec +loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') +spec = spec_from_loader(loader.name, loader) +func = module_from_spec(spec) +loader.exec_module(func) +for key, value in dict(locals()).items(): + if key != ['SourceFileLoader', 'func']: + setattr(func, key, value) +try: + from tiramisu3 import * +except: + from tiramisu import * +from rougail.tiramisu import ConvertDynOptionDescription +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), '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]) diff --git a/tests/dictionaries/10load_disabled_if_inaccent_family/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_inaccent_family/tiramisu/base.py index 13ebd570..358d96f8 100644 --- a/tests/dictionaries/10load_disabled_if_inaccent_family/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_inaccent_family/tiramisu/base.py @@ -13,10 +13,10 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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"})) -option_6 = OptionDescription(name="general2", doc="Général2", children=[option_7], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=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('disabled'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py index 06006abe..0ce154b0 100644 --- a/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_fallback/tiramisu/base.py @@ -14,7 +14,7 @@ except: from rougail.tiramisu import ConvertDynOptionDescription 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), '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), '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]) diff --git a/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py index 39342d52..72702194 100644 --- a/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_fallback_force/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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]) diff --git a/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py index 39342d52..72702194 100644 --- a/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py +++ b/tests/dictionaries/10load_disabledifin_whithouttype/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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]) diff --git a/tests/dictionaries/10load_frozenifin/tiramisu/base.py b/tests/dictionaries/10load_frozenifin/tiramisu/base.py index e59e0d50..54513960 100644 --- a/tests/dictionaries/10load_frozenifin/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_frozenifin_auto/00-base.xml b/tests/dictionaries/10load_frozenifin_auto/00-base.xml index 0882d249..38704bb4 100644 --- a/tests/dictionaries/10load_frozenifin_auto/00-base.xml +++ b/tests/dictionaries/10load_frozenifin_auto/00-base.xml @@ -20,8 +20,9 @@ mode_conteneur_actif mode_conteneur_actif2 - + non + mode_conteneur_actif diff --git a/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py index e6299a6e..2d9d359f 100644 --- a/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_auto/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_frozenifin_multiparam/00-base.xml b/tests/dictionaries/10load_frozenifin_multiparam/00-base.xml index c3512f52..3006f138 100644 --- a/tests/dictionaries/10load_frozenifin_multiparam/00-base.xml +++ b/tests/dictionaries/10load_frozenifin_multiparam/00-base.xml @@ -15,10 +15,11 @@ - + tous authentifié aucun + condition tous diff --git a/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py index 1267d620..6ce4c30f 100644 --- a/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_multiparam/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')}))})) +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), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("tous")})), Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("authentifié")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_frozenifin_noexist/00-base.xml b/tests/dictionaries/10load_frozenifin_noexist/00-base.xml index 71ad9db5..4cefd881 100644 --- a/tests/dictionaries/10load_frozenifin_noexist/00-base.xml +++ b/tests/dictionaries/10load_frozenifin_noexist/00-base.xml @@ -17,10 +17,11 @@ - + tous authentifié aucun + condition oui diff --git a/tests/dictionaries/10load_frozenifin_variable/00-base.xml b/tests/dictionaries/10load_frozenifin_variable/00-base.xml index cac5aee5..ed067251 100644 --- a/tests/dictionaries/10load_frozenifin_variable/00-base.xml +++ b/tests/dictionaries/10load_frozenifin_variable/00-base.xml @@ -17,10 +17,11 @@ - + tous authentifié aucun + condition mode_conteneur_actif diff --git a/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py b/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py index c3cac38d..40d7ae20 100644 --- a/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifin_variable/tiramisu/base.py @@ -14,7 +14,7 @@ except: from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('mode_conteneur_actif')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('mode_conteneur_actif')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('mode_conteneur_actif')}))})) +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), 'expected': ParamOption(option_4)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamOption(option_4)})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py b/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py index e76e90e8..07ded3ca 100644 --- a/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py +++ b/tests/dictionaries/10load_frozenifnotin/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=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), '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), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +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), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=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), '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), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=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), '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]) diff --git a/tests/dictionaries/10load_frozenifnotin_noexist/00-base.xml b/tests/dictionaries/10load_frozenifnotin_noexist/00-base.xml index 07d2c45b..ed047181 100644 --- a/tests/dictionaries/10load_frozenifnotin_noexist/00-base.xml +++ b/tests/dictionaries/10load_frozenifnotin_noexist/00-base.xml @@ -17,10 +17,11 @@ - + tous authentifié aucun + condition oui 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 a0554aee..4cdd465d 100644 --- a/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py +++ b/tests/dictionaries/10load_hidden_if_empty_family/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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]) diff --git a/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py b/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py index 5e09a009..77e4029e 100644 --- a/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py +++ b/tests/dictionaries/10load_hidden_if_family/tiramisu/base.py @@ -13,10 +13,10 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=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), '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]) diff --git a/tests/dictionaries/10load_leadership/00-base.xml b/tests/dictionaries/10load_leadership/00-base.xml index 05dc32ef..e89d1b86 100644 --- a/tests/dictionaries/10load_leadership/00-base.xml +++ b/tests/dictionaries/10load_leadership/00-base.xml @@ -14,11 +14,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/10load_leadership_description/00-base.xml b/tests/dictionaries/10load_leadership_description/00-base.xml index bc4f10f7..3be9613d 100644 --- a/tests/dictionaries/10load_leadership_description/00-base.xml +++ b/tests/dictionaries/10load_leadership_description/00-base.xml @@ -13,11 +13,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/10load_leadership_name/00-base.xml b/tests/dictionaries/10load_leadership_name/00-base.xml index 365e95b0..d5e535f5 100644 --- a/tests/dictionaries/10load_leadership_name/00-base.xml +++ b/tests/dictionaries/10load_leadership_name/00-base.xml @@ -13,11 +13,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/10load_leadership_submulti/00-base.xml b/tests/dictionaries/10load_leadership_submulti/00-base.xml index ca044ac2..cb244da4 100644 --- a/tests/dictionaries/10load_leadership_submulti/00-base.xml +++ b/tests/dictionaries/10load_leadership_submulti/00-base.xml @@ -14,11 +14,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py b/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py index 5972505d..f5aa4a72 100644 --- a/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py +++ b/tests/dictionaries/10load_mandatoryifin/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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]) diff --git a/tests/dictionaries/10load_mandatoryifnotin_noexist/00-base.xml b/tests/dictionaries/10load_mandatoryifnotin_noexist/00-base.xml index f73b4da4..1506b72e 100644 --- a/tests/dictionaries/10load_mandatoryifnotin_noexist/00-base.xml +++ b/tests/dictionaries/10load_mandatoryifnotin_noexist/00-base.xml @@ -17,10 +17,11 @@ - + tous authentifié aucun + condition oui diff --git a/tests/dictionaries/10valid_enum_accent/00-base.xml b/tests/dictionaries/10valid_enum_accent/00-base.xml index ea86a187..dd814cc2 100644 --- a/tests/dictionaries/10valid_enum_accent/00-base.xml +++ b/tests/dictionaries/10valid_enum_accent/00-base.xml @@ -14,11 +14,12 @@ - + a b c é + enumvar diff --git a/tests/dictionaries/10valid_enum_base/00-base.xml b/tests/dictionaries/10valid_enum_base/00-base.xml index 3a461cb1..0c6eca09 100644 --- a/tests/dictionaries/10valid_enum_base/00-base.xml +++ b/tests/dictionaries/10valid_enum_base/00-base.xml @@ -14,10 +14,11 @@ - + a b c + enumvar diff --git a/tests/dictionaries/10valid_enum_base_redefine/00-base.xml b/tests/dictionaries/10valid_enum_base_redefine/00-base.xml index e4986d76..c0b42eda 100644 --- a/tests/dictionaries/10valid_enum_base_redefine/00-base.xml +++ b/tests/dictionaries/10valid_enum_base_redefine/00-base.xml @@ -17,15 +17,17 @@ - + a b c + enumvar - + a b c + enumvar2 diff --git a/tests/dictionaries/10valid_enum_base_redefine/01-base.xml b/tests/dictionaries/10valid_enum_base_redefine/01-base.xml index 0a3e784f..2e2d62a6 100644 --- a/tests/dictionaries/10valid_enum_base_redefine/01-base.xml +++ b/tests/dictionaries/10valid_enum_base_redefine/01-base.xml @@ -9,9 +9,10 @@ - + a c + enumvar diff --git a/tests/dictionaries/10valid_enum_leader/00-base.xml b/tests/dictionaries/10valid_enum_leader/00-base.xml index dac27254..f8e4d55e 100644 --- a/tests/dictionaries/10valid_enum_leader/00-base.xml +++ b/tests/dictionaries/10valid_enum_leader/00-base.xml @@ -12,10 +12,11 @@ - + a b c + follower1 follower1 diff --git a/tests/dictionaries/10valid_enum_mandatory/00-base.xml b/tests/dictionaries/10valid_enum_mandatory/00-base.xml index 98475c8a..8fcf4d05 100644 --- a/tests/dictionaries/10valid_enum_mandatory/00-base.xml +++ b/tests/dictionaries/10valid_enum_mandatory/00-base.xml @@ -13,10 +13,11 @@ - + a b c + enumvar diff --git a/tests/dictionaries/10valid_enum_multi/00-base.xml b/tests/dictionaries/10valid_enum_multi/00-base.xml index d9605f61..1434167d 100644 --- a/tests/dictionaries/10valid_enum_multi/00-base.xml +++ b/tests/dictionaries/10valid_enum_multi/00-base.xml @@ -10,10 +10,11 @@ - + a b c + multi diff --git a/tests/dictionaries/10valid_enum_none/00-base.xml b/tests/dictionaries/10valid_enum_none/00-base.xml index 0f34cb86..1e9d5272 100644 --- a/tests/dictionaries/10valid_enum_none/00-base.xml +++ b/tests/dictionaries/10valid_enum_none/00-base.xml @@ -14,10 +14,11 @@ - + a b - + + enumvar diff --git a/tests/dictionaries/10valid_enum_number/00-base.xml b/tests/dictionaries/10valid_enum_number/00-base.xml index 1d00d64d..78749169 100644 --- a/tests/dictionaries/10valid_enum_number/00-base.xml +++ b/tests/dictionaries/10valid_enum_number/00-base.xml @@ -12,10 +12,11 @@ - + 1 2 3 + enumvar diff --git a/tests/dictionaries/10valid_enum_numberdefault/00-base.xml b/tests/dictionaries/10valid_enum_numberdefault/00-base.xml index b0bd9dc0..3cab8e15 100644 --- a/tests/dictionaries/10valid_enum_numberdefault/00-base.xml +++ b/tests/dictionaries/10valid_enum_numberdefault/00-base.xml @@ -14,10 +14,11 @@ - + 1 2 3 + enumvar diff --git a/tests/dictionaries/10valid_enum_param_empty/00-base.xml b/tests/dictionaries/10valid_enum_param_empty/00-base.xml index 1910723e..35b0865e 100644 --- a/tests/dictionaries/10valid_enum_param_empty/00-base.xml +++ b/tests/dictionaries/10valid_enum_param_empty/00-base.xml @@ -12,8 +12,9 @@ - - + + + enumvar diff --git a/tests/dictionaries/10valid_enum_param_empty2/00-base.xml b/tests/dictionaries/10valid_enum_param_empty2/00-base.xml index 6edacb81..1fbf9075 100644 --- a/tests/dictionaries/10valid_enum_param_empty2/00-base.xml +++ b/tests/dictionaries/10valid_enum_param_empty2/00-base.xml @@ -12,8 +12,9 @@ - - + + + enumvar diff --git a/tests/dictionaries/10valid_enum_quote/00-base.xml b/tests/dictionaries/10valid_enum_quote/00-base.xml index 8e1bfbef..216c4a3e 100644 --- a/tests/dictionaries/10valid_enum_quote/00-base.xml +++ b/tests/dictionaries/10valid_enum_quote/00-base.xml @@ -12,10 +12,11 @@ - + quote' quote" quote"' + enumvar diff --git a/tests/dictionaries/10valid_enum_value/00-base.xml b/tests/dictionaries/10valid_enum_value/00-base.xml index fd8b959d..93d61123 100644 --- a/tests/dictionaries/10valid_enum_value/00-base.xml +++ b/tests/dictionaries/10valid_enum_value/00-base.xml @@ -9,10 +9,11 @@ - + a b c + mode_conteneur_actif diff --git a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py index 9a2845c5..486a9947 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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 = StrOption(name="group", doc="group", default="root") 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 183b570b..cde57edf 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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 = StrOption(name="group", doc="group", default="root") 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 7b968e92..08882174 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py @@ -13,8 +13,8 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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 = StrOption(name="group", doc="group", default="root") diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/00-base.xml b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/00-base.xml index 7451d99c..c761c403 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/00-base.xml +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/00-base.xml @@ -22,9 +22,10 @@ - + non statique + condition statique diff --git a/tests/dictionaries/11valid_enum_variable/00-base.xml b/tests/dictionaries/11valid_enum_variable/00-base.xml index 0a63345c..631ea131 100644 --- a/tests/dictionaries/11valid_enum_variable/00-base.xml +++ b/tests/dictionaries/11valid_enum_variable/00-base.xml @@ -13,8 +13,9 @@ - + var + mode_conteneur_actif diff --git a/tests/dictionaries/20family_appendaccent/tiramisu/base.py b/tests/dictionaries/20family_appendaccent/tiramisu/base.py index 826dc53a..1258876e 100644 --- a/tests/dictionaries/20family_appendaccent/tiramisu/base.py +++ b/tests/dictionaries/20family_appendaccent/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_7 = StrOption(name="mode_conteneur_actif3", 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({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue('non')}))})) +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_7, todict=True), 'expected': ParamValue("non")}))})) 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({"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"})) diff --git a/tests/dictionaries/20family_dynamic_calc/00-base.xml b/tests/dictionaries/20family_dynamic_calc/00-base.xml index 7fa2ca78..ee895a57 100644 --- a/tests/dictionaries/20family_dynamic_calc/00-base.xml +++ b/tests/dictionaries/20family_dynamic_calc/00-base.xml @@ -18,8 +18,9 @@ - + vardynval1 + newvar diff --git a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py index e63b1d6d..2dc884f9 100644 --- a/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py +++ b/tests/dictionaries/20family_dynamic_calc2/tiramisu/base.py @@ -15,8 +15,8 @@ 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), 'expected': ParamValue('non')})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue('non')}))})) -option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue('non')}))})) +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), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue("non")}))})) +option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=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]) diff --git a/tests/dictionaries/20family_dynamic_calc_suffix/00-base.xml b/tests/dictionaries/20family_dynamic_calc_suffix/00-base.xml index a8e758a8..dfb734d7 100644 --- a/tests/dictionaries/20family_dynamic_calc_suffix/00-base.xml +++ b/tests/dictionaries/20family_dynamic_calc_suffix/00-base.xml @@ -18,8 +18,9 @@ - + + vardyn diff --git a/tests/dictionaries/20family_dynamic_number/00-base.xml b/tests/dictionaries/20family_dynamic_number/00-base.xml index b085ce9c..a155322d 100644 --- a/tests/dictionaries/20family_dynamic_number/00-base.xml +++ b/tests/dictionaries/20family_dynamic_number/00-base.xml @@ -18,8 +18,9 @@ - + vardyn1 + newvar diff --git a/tests/dictionaries/30mandatory_withoutvaluecalc/00-base.xml b/tests/dictionaries/30mandatory_withoutvaluecalc/00-base.xml index aec57606..9622b3d7 100644 --- a/tests/dictionaries/30mandatory_withoutvaluecalc/00-base.xml +++ b/tests/dictionaries/30mandatory_withoutvaluecalc/00-base.xml @@ -6,8 +6,9 @@ - + value + mode_conteneur_actif diff --git a/tests/dictionaries/30mandatory_withvaluecalc/00-base.xml b/tests/dictionaries/30mandatory_withvaluecalc/00-base.xml index 93ae7b1f..a5a6f5d4 100644 --- a/tests/dictionaries/30mandatory_withvaluecalc/00-base.xml +++ b/tests/dictionaries/30mandatory_withvaluecalc/00-base.xml @@ -6,8 +6,9 @@ - + value + mode_conteneur_actif diff --git a/tests/dictionaries/40condition_base/tiramisu/base.py b/tests/dictionaries/40condition_base/tiramisu/base.py index da6cce64..7a977d97 100644 --- a/tests/dictionaries/40condition_base/tiramisu/base.py +++ b/tests/dictionaries/40condition_base/tiramisu/base.py @@ -14,8 +14,8 @@ except: from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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]) diff --git a/tests/dictionaries/40condition_base_add/tiramisu/base.py b/tests/dictionaries/40condition_base_add/tiramisu/base.py index da6cce64..7a977d97 100644 --- a/tests/dictionaries/40condition_base_add/tiramisu/base.py +++ b/tests/dictionaries/40condition_base_add/tiramisu/base.py @@ -14,8 +14,8 @@ except: from rougail.tiramisu import ConvertDynOptionDescription 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), '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), 'expected': ParamValue('oui')}))})) +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), '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), '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]) diff --git a/tests/dictionaries/40condition_optional/tiramisu/base.py b/tests/dictionaries/40condition_optional/tiramisu/base.py index 0aba831c..cc646169 100644 --- a/tests/dictionaries/40condition_optional/tiramisu/base.py +++ b/tests/dictionaries/40condition_optional/tiramisu/base.py @@ -14,7 +14,7 @@ except: from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')}))})) +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), '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]) diff --git a/tests/dictionaries/40empty_param/00_base.xml b/tests/dictionaries/40empty_param/00_base.xml index 00a7a201..63ffbb72 100644 --- a/tests/dictionaries/40empty_param/00_base.xml +++ b/tests/dictionaries/40empty_param/00_base.xml @@ -13,8 +13,9 @@ - - + + + toto1 diff --git a/tests/dictionaries/40empty_param2/00_base.xml b/tests/dictionaries/40empty_param2/00_base.xml index 9c0fa4f0..f3b38b92 100644 --- a/tests/dictionaries/40empty_param2/00_base.xml +++ b/tests/dictionaries/40empty_param2/00_base.xml @@ -13,8 +13,9 @@ - - + + + toto1 diff --git a/tests/dictionaries/40ifin_leadership/tiramisu/base.py b/tests/dictionaries/40ifin_leadership/tiramisu/base.py index 3cde0a55..259523c8 100644 --- a/tests/dictionaries/40ifin_leadership/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadership/tiramisu/base.py @@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')}))})) +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), '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"})) diff --git a/tests/dictionaries/40ifin_leadershipauto/00-base.xml b/tests/dictionaries/40ifin_leadershipauto/00-base.xml index d4613e66..e5d2cd44 100644 --- a/tests/dictionaries/40ifin_leadershipauto/00-base.xml +++ b/tests/dictionaries/40ifin_leadershipauto/00-base.xml @@ -25,8 +25,9 @@ follower1 follower2 - + valfill + follower1 oui diff --git a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py index ba89cd83..c6ea2ee4 100644 --- a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py @@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')}))})) +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), '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"})) diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/00-base.xml b/tests/dictionaries/40ifin_leadershipauto_follower/00-base.xml index 1ca1d604..d9fc0573 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/00-base.xml +++ b/tests/dictionaries/40ifin_leadershipauto_follower/00-base.xml @@ -26,8 +26,9 @@ follower1 follower2 - + valfill + follower1 a diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py index c48b5326..d63bfaa4 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py @@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('a')}))})) +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), '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"})) diff --git a/tests/dictionaries/40ifin_multi/tiramisu/base.py b/tests/dictionaries/40ifin_multi/tiramisu/base.py index 6ef07e5c..45e840c3 100644 --- a/tests/dictionaries/40ifin_multi/tiramisu/base.py +++ b/tests/dictionaries/40ifin_multi/tiramisu/base.py @@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue('oui')}))})) +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), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=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]) diff --git a/tests/dictionaries/40ifin_validenum/00-base.xml b/tests/dictionaries/40ifin_validenum/00-base.xml index ba3fcb34..6385a45f 100644 --- a/tests/dictionaries/40ifin_validenum/00-base.xml +++ b/tests/dictionaries/40ifin_validenum/00-base.xml @@ -14,10 +14,11 @@ - + a b c + mode_conteneur_actif3 d diff --git a/tests/dictionaries/51redefine_auto/00-base.xml b/tests/dictionaries/51redefine_auto/00-base.xml index a1ceb0c4..7626870e 100644 --- a/tests/dictionaries/51redefine_auto/00-base.xml +++ b/tests/dictionaries/51redefine_auto/00-base.xml @@ -9,8 +9,9 @@ - + non + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_auto/01-base.xml b/tests/dictionaries/51redefine_auto/01-base.xml index 17a39f9b..3ddb1d5e 100644 --- a/tests/dictionaries/51redefine_auto/01-base.xml +++ b/tests/dictionaries/51redefine_auto/01-base.xml @@ -7,8 +7,9 @@ - + non + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_autofill/00-base.xml b/tests/dictionaries/51redefine_autofill/00-base.xml index c3241c4d..d9a4c31f 100644 --- a/tests/dictionaries/51redefine_autofill/00-base.xml +++ b/tests/dictionaries/51redefine_autofill/00-base.xml @@ -9,8 +9,9 @@ - + oui + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_autofill/01-base.xml b/tests/dictionaries/51redefine_autofill/01-base.xml index 712a6b98..3c60a472 100644 --- a/tests/dictionaries/51redefine_autofill/01-base.xml +++ b/tests/dictionaries/51redefine_autofill/01-base.xml @@ -7,8 +7,9 @@ - + non + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_family/tiramisu/base.py b/tests/dictionaries/51redefine_family/tiramisu/base.py index ab362993..030c7c00 100644 --- a/tests/dictionaries/51redefine_family/tiramisu/base.py +++ b/tests/dictionaries/51redefine_family/tiramisu/base.py @@ -15,6 +15,6 @@ from rougail.tiramisu import ConvertDynOptionDescription 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), 'expected': ParamValue('oui')}))})) +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), '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]) diff --git a/tests/dictionaries/51redefine_fill/00-base.xml b/tests/dictionaries/51redefine_fill/00-base.xml index c3241c4d..d9a4c31f 100644 --- a/tests/dictionaries/51redefine_fill/00-base.xml +++ b/tests/dictionaries/51redefine_fill/00-base.xml @@ -9,8 +9,9 @@ - + oui + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_fill/01-base.xml b/tests/dictionaries/51redefine_fill/01-base.xml index 17a39f9b..3ddb1d5e 100644 --- a/tests/dictionaries/51redefine_fill/01-base.xml +++ b/tests/dictionaries/51redefine_fill/01-base.xml @@ -7,8 +7,9 @@ - + non + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_fillauto/00-base.xml b/tests/dictionaries/51redefine_fillauto/00-base.xml index 0a3aee45..e1a35194 100644 --- a/tests/dictionaries/51redefine_fillauto/00-base.xml +++ b/tests/dictionaries/51redefine_fillauto/00-base.xml @@ -9,8 +9,9 @@ - + oui + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_fillauto/01-base.xml b/tests/dictionaries/51redefine_fillauto/01-base.xml index 1c9d3331..ed410ea5 100644 --- a/tests/dictionaries/51redefine_fillauto/01-base.xml +++ b/tests/dictionaries/51redefine_fillauto/01-base.xml @@ -7,8 +7,9 @@ - + non + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_remove_check/00-base.xml b/tests/dictionaries/51redefine_remove_check/00-base.xml index 4b82d1d1..e4777675 100644 --- a/tests/dictionaries/51redefine_remove_check/00-base.xml +++ b/tests/dictionaries/51redefine_remove_check/00-base.xml @@ -7,10 +7,11 @@ - + a b c + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py index 61ce69ef..86daaadf 100644 --- a/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py +++ b/tests/dictionaries/51redefine_removecondition_nonautofreeze/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_7 = StrOption(name="module_instancie", 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({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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"})) diff --git a/tests/dictionaries/51redefine_validenum/00-base.xml b/tests/dictionaries/51redefine_validenum/00-base.xml index a2ae1b83..bce705c5 100644 --- a/tests/dictionaries/51redefine_validenum/00-base.xml +++ b/tests/dictionaries/51redefine_validenum/00-base.xml @@ -6,10 +6,11 @@ - + a b c + mode_conteneur_actif diff --git a/tests/dictionaries/51redefine_validenum/01-redefine.xml b/tests/dictionaries/51redefine_validenum/01-redefine.xml index faf00307..7b54aef9 100644 --- a/tests/dictionaries/51redefine_validenum/01-redefine.xml +++ b/tests/dictionaries/51redefine_validenum/01-redefine.xml @@ -6,9 +6,10 @@ - + a b + mode_conteneur_actif diff --git a/tests/dictionaries/51remove_fill/00-base.xml b/tests/dictionaries/51remove_fill/00-base.xml index 4dd0c58b..a51dfd6c 100644 --- a/tests/dictionaries/51remove_fill/00-base.xml +++ b/tests/dictionaries/51remove_fill/00-base.xml @@ -12,8 +12,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/60action_external/extra_dirs/extra/00-base.xml b/tests/dictionaries/60action_external/extra_dirs/extra/00-base.xml index 12840066..35d9a786 100644 --- a/tests/dictionaries/60action_external/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60action_external/extra_dirs/extra/00-base.xml @@ -10,8 +10,9 @@ - + http://localhost/ + extra.test.calc_url diff --git a/tests/dictionaries/60extra_externalspaceauto/extra_dirs/extra1/00-base.xml b/tests/dictionaries/60extra_externalspaceauto/extra_dirs/extra1/00-base.xml index 1b015543..2745b5d7 100644 --- a/tests/dictionaries/60extra_externalspaceauto/extra_dirs/extra1/00-base.xml +++ b/tests/dictionaries/60extra_externalspaceauto/extra_dirs/extra1/00-base.xml @@ -9,11 +9,12 @@ - + non extra.ejabberd.day none daily + extra1.external.description diff --git a/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py b/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py index 2ee00311..113bc42d 100644 --- a/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py +++ b/tests/dictionaries/60extra_externalspacecondition/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_5 = StrOption(name="module_instancie", 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({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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, option_5], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) @@ -23,6 +23,6 @@ option_10 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), defaul 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), 'expected': ParamValue('non')}))})) +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), '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]) diff --git a/tests/dictionaries/60extra_help/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_help/extra_dirs/extra/00-base.xml index 9fc5d561..f751c2bc 100644 --- a/tests/dictionaries/60extra_help/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60extra_help/extra_dirs/extra/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/60extra_load/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_load/extra_dirs/extra/00-base.xml index 884da0f4..adb57b0e 100644 --- a/tests/dictionaries/60extra_load/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60extra_load/extra_dirs/extra/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/60extra_mandatory/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_mandatory/extra_dirs/extra/00-base.xml index e6d6ccd1..cca67d91 100644 --- a/tests/dictionaries/60extra_mandatory/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60extra_mandatory/extra_dirs/extra/00-base.xml @@ -12,11 +12,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/60extra_name_family/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_name_family/extra_dirs/extra/00-base.xml index 884da0f4..adb57b0e 100644 --- a/tests/dictionaries/60extra_name_family/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60extra_name_family/extra_dirs/extra/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/60extra_no_condition/tiramisu/base.py b/tests/dictionaries/60extra_no_condition/tiramisu/base.py index 3ca1790f..a8d37abd 100644 --- a/tests/dictionaries/60extra_no_condition/tiramisu/base.py +++ b/tests/dictionaries/60extra_no_condition/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * from rougail.tiramisu import ConvertDynOptionDescription option_5 = StrOption(name="module_instancie", 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({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) 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, option_5], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) diff --git a/tests/dictionaries/60extra_redefine/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_redefine/extra_dirs/extra/00-base.xml index 884da0f4..adb57b0e 100644 --- a/tests/dictionaries/60extra_redefine/extra_dirs/extra/00-base.xml +++ b/tests/dictionaries/60extra_redefine/extra_dirs/extra/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/80auto_family/00-base.xml b/tests/dictionaries/80auto_family/00-base.xml new file mode 100644 index 00000000..61d6b9dc --- /dev/null +++ b/tests/dictionaries/80auto_family/00-base.xml @@ -0,0 +1,18 @@ + + + + + + no + + + + + + oui + general + + + + diff --git a/tests/dictionaries/80check_unknown_var/errno_2 b/tests/dictionaries/80auto_family/__init__.py similarity index 100% rename from tests/dictionaries/80check_unknown_var/errno_2 rename to tests/dictionaries/80auto_family/__init__.py diff --git a/tests/dictionaries/80check_without_target/errno_43 b/tests/dictionaries/80auto_family/errno_2 similarity index 100% rename from tests/dictionaries/80check_without_target/errno_43 rename to tests/dictionaries/80auto_family/errno_2 diff --git a/tests/dictionaries/80check_unknown/00-base.xml b/tests/dictionaries/80check_unknown/00-base.xml index b8600cd7..46304593 100644 --- a/tests/dictionaries/80check_unknown/00-base.xml +++ b/tests/dictionaries/80check_unknown/00-base.xml @@ -10,9 +10,10 @@ - + 0 100 + int diff --git a/tests/dictionaries/80check_unknown_var/00-base.xml b/tests/dictionaries/80check_unknown_var/00-base.xml index d5e0f432..cb9eedb8 100644 --- a/tests/dictionaries/80check_unknown_var/00-base.xml +++ b/tests/dictionaries/80check_unknown_var/00-base.xml @@ -9,8 +9,9 @@ - + int3 + mode_conteneur_actif diff --git a/tests/dictionaries/80family_dynamic_check/errno_22 b/tests/dictionaries/80check_unknown_var/errno_42 similarity index 100% rename from tests/dictionaries/80family_dynamic_check/errno_22 rename to tests/dictionaries/80check_unknown_var/errno_42 diff --git a/tests/dictionaries/80family_only_on_suffix/errno_26 b/tests/dictionaries/80check_without_target/errno_9 similarity index 100% rename from tests/dictionaries/80family_only_on_suffix/errno_26 rename to tests/dictionaries/80check_without_target/errno_9 diff --git a/tests/dictionaries/80empty_param_number/00_base.xml b/tests/dictionaries/80empty_param_number/00_base.xml index f2a2228d..55d9aa1a 100644 --- a/tests/dictionaries/80empty_param_number/00_base.xml +++ b/tests/dictionaries/80empty_param_number/00_base.xml @@ -13,8 +13,9 @@ - + + toto1 diff --git a/tests/dictionaries/80empty_typeeole_eole/00_base.xml b/tests/dictionaries/80empty_typeeole_eole/00_base.xml index 31ce99fb..1d6518c7 100644 --- a/tests/dictionaries/80empty_typeeole_eole/00_base.xml +++ b/tests/dictionaries/80empty_typeeole_eole/00_base.xml @@ -13,11 +13,12 @@ - + non 3128 toto2 + toto1 diff --git a/tests/dictionaries/80empty_typeeole_number/00_base.xml b/tests/dictionaries/80empty_typeeole_number/00_base.xml index d878380d..0075c541 100644 --- a/tests/dictionaries/80empty_typeeole_number/00_base.xml +++ b/tests/dictionaries/80empty_typeeole_number/00_base.xml @@ -13,11 +13,12 @@ - + non 3128 toto2 + toto1 diff --git a/tests/dictionaries/80extra_rougail/extra_dirs/rougail/00-base.xml b/tests/dictionaries/80extra_rougail/extra_dirs/rougail/00-base.xml index f9173523..012ae57a 100644 --- a/tests/dictionaries/80extra_rougail/extra_dirs/rougail/00-base.xml +++ b/tests/dictionaries/80extra_rougail/extra_dirs/rougail/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/80extra_services/extra_dirs/services/00-base.xml b/tests/dictionaries/80extra_services/extra_dirs/services/00-base.xml index 884da0f4..adb57b0e 100644 --- a/tests/dictionaries/80extra_services/extra_dirs/services/00-base.xml +++ b/tests/dictionaries/80extra_services/extra_dirs/services/00-base.xml @@ -13,11 +13,12 @@ - + non activer_ejabberd none daily + extra.ejabberd.day diff --git a/tests/dictionaries/80family_dynamic_calc_invalid_suffix/00-base.xml b/tests/dictionaries/80family_dynamic_calc_invalid_suffix/00-base.xml index 10766b76..024c1fdd 100644 --- a/tests/dictionaries/80family_dynamic_calc_invalid_suffix/00-base.xml +++ b/tests/dictionaries/80family_dynamic_calc_invalid_suffix/00-base.xml @@ -18,8 +18,9 @@ - + unknown + vardyn diff --git a/tests/dictionaries/80family_dynamic_check/00-base.xml b/tests/dictionaries/80family_dynamic_check/00-base.xml index 571af0c3..f6497d08 100644 --- a/tests/dictionaries/80family_dynamic_check/00-base.xml +++ b/tests/dictionaries/80family_dynamic_check/00-base.xml @@ -13,9 +13,10 @@ - + 0 100 + vardynval1 diff --git a/tests/dictionaries/80valid_enum_number_without_value/errno_8 b/tests/dictionaries/80family_dynamic_check/errno_35 similarity index 100% rename from tests/dictionaries/80valid_enum_number_without_value/errno_8 rename to tests/dictionaries/80family_dynamic_check/errno_35 diff --git a/tests/dictionaries/80family_not_dynamic_calc_suffix/00-base.xml b/tests/dictionaries/80family_not_dynamic_calc_suffix/00-base.xml index 04b287be..b3f8b786 100644 --- a/tests/dictionaries/80family_not_dynamic_calc_suffix/00-base.xml +++ b/tests/dictionaries/80family_not_dynamic_calc_suffix/00-base.xml @@ -18,8 +18,9 @@ - + + newvar diff --git a/tests/dictionaries/80family_only_on_suffix/00-base.xml b/tests/dictionaries/80family_only_on_suffix/00-base.xml index 7fac5b7d..ce92e943 100644 --- a/tests/dictionaries/80family_only_on_suffix/00-base.xml +++ b/tests/dictionaries/80family_only_on_suffix/00-base.xml @@ -13,8 +13,9 @@ - + value + vardynval1 diff --git a/tests/dictionaries/80family_only_on_suffix/errno_35 b/tests/dictionaries/80family_only_on_suffix/errno_35 new file mode 100644 index 00000000..e69de29b diff --git a/tests/dictionaries/80family_several/00-base.xml b/tests/dictionaries/80family_several/00-base.xml index 294dc202..ca54b102 100644 --- a/tests/dictionaries/80family_several/00-base.xml +++ b/tests/dictionaries/80family_several/00-base.xml @@ -14,11 +14,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80fill_error/00-base.xml b/tests/dictionaries/80fill_error/00-base.xml index 843e24ba..a0dc5190 100644 --- a/tests/dictionaries/80fill_error/00-base.xml +++ b/tests/dictionaries/80fill_error/00-base.xml @@ -10,11 +10,13 @@ - + valeur + mode_conteneur_actif - + valeur2 + mode_conteneur_actif diff --git a/tests/dictionaries/80fill_multi/00-base.xml b/tests/dictionaries/80fill_multi/00-base.xml index 0be70367..639475ab 100644 --- a/tests/dictionaries/80fill_multi/00-base.xml +++ b/tests/dictionaries/80fill_multi/00-base.xml @@ -12,11 +12,13 @@ - + value + mode_conteneur_actif - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/80fill_not_exists/00-base.xml b/tests/dictionaries/80fill_not_exists/00-base.xml index ff5660eb..6c080b91 100644 --- a/tests/dictionaries/80fill_not_exists/00-base.xml +++ b/tests/dictionaries/80fill_not_exists/00-base.xml @@ -12,10 +12,11 @@ - + mode_conteneur_actif4 mode_conteneur_actif1 mode_conteneur_actif3 + mode_conteneur_actif diff --git a/tests/dictionaries/80fill_unknown_function/00-base.xml b/tests/dictionaries/80fill_unknown_function/00-base.xml index e4a59aee..4cf1dd5a 100644 --- a/tests/dictionaries/80fill_unknown_function/00-base.xml +++ b/tests/dictionaries/80fill_unknown_function/00-base.xml @@ -10,8 +10,9 @@ - + mode_conteneur_actif1 + mode_conteneur_actif diff --git a/tests/dictionaries/80frozenifin_unknown/00-base.xml b/tests/dictionaries/80frozenifin_unknown/00-base.xml index 483361f6..734a13da 100644 --- a/tests/dictionaries/80frozenifin_unknown/00-base.xml +++ b/tests/dictionaries/80frozenifin_unknown/00-base.xml @@ -13,10 +13,11 @@ - + 1 2 3 + enumvar 4 diff --git a/tests/dictionaries/80leadership_auto_save/00-base.xml b/tests/dictionaries/80leadership_auto_save/00-base.xml index d0c0160c..eaee21c5 100644 --- a/tests/dictionaries/80leadership_auto_save/00-base.xml +++ b/tests/dictionaries/80leadership_auto_save/00-base.xml @@ -12,11 +12,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80leadership_autofreeze/00-base.xml b/tests/dictionaries/80leadership_autofreeze/00-base.xml index b157a1c1..28c7ec47 100644 --- a/tests/dictionaries/80leadership_autofreeze/00-base.xml +++ b/tests/dictionaries/80leadership_autofreeze/00-base.xml @@ -10,11 +10,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80leadership_none_follower_between_follower/00-base.xml b/tests/dictionaries/80leadership_none_follower_between_follower/00-base.xml index 847e0d30..e5844f8b 100644 --- a/tests/dictionaries/80leadership_none_follower_between_follower/00-base.xml +++ b/tests/dictionaries/80leadership_none_follower_between_follower/00-base.xml @@ -12,11 +12,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80leadership_not_ordered/00-base.xml b/tests/dictionaries/80leadership_not_ordered/00-base.xml index 4f01b972..f5cce43e 100644 --- a/tests/dictionaries/80leadership_not_ordered/00-base.xml +++ b/tests/dictionaries/80leadership_not_ordered/00-base.xml @@ -14,11 +14,13 @@ - + valfill + follower1 - + follower1 + follower2 follower2 diff --git a/tests/dictionaries/80leadership_not_same_family/00-base.xml b/tests/dictionaries/80leadership_not_same_family/00-base.xml index cb55755a..6f5b92a8 100644 --- a/tests/dictionaries/80leadership_not_same_family/00-base.xml +++ b/tests/dictionaries/80leadership_not_same_family/00-base.xml @@ -16,11 +16,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80leadership_notexists/00-base.xml b/tests/dictionaries/80leadership_notexists/00-base.xml index a1e0cdff..60410746 100644 --- a/tests/dictionaries/80leadership_notexists/00-base.xml +++ b/tests/dictionaries/80leadership_notexists/00-base.xml @@ -12,11 +12,13 @@ - + valfill + follower1 - + follower1 + follower2 follower1 diff --git a/tests/dictionaries/80nil_with_value/00-base.xml b/tests/dictionaries/80nil_with_value/00-base.xml new file mode 100644 index 00000000..979b33a9 --- /dev/null +++ b/tests/dictionaries/80nil_with_value/00-base.xml @@ -0,0 +1,27 @@ + + + + + + non + + + + + + + + + value + mode_conteneur_actif + mode_conteneur_actif2 + afilllist + + + + diff --git a/tests/dictionaries/80nil_with_value/__init__.py b/tests/dictionaries/80nil_with_value/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/dictionaries/80nil_with_value/errno_40 b/tests/dictionaries/80nil_with_value/errno_40 new file mode 100644 index 00000000..e69de29b diff --git a/tests/dictionaries/80redefine_fillerror/00-base.xml b/tests/dictionaries/80redefine_fillerror/00-base.xml index 493cb616..2e2049b8 100644 --- a/tests/dictionaries/80redefine_fillerror/00-base.xml +++ b/tests/dictionaries/80redefine_fillerror/00-base.xml @@ -9,8 +9,9 @@ - + valeur + mode_conteneur_actif diff --git a/tests/dictionaries/80redefine_fillerror/01-base.xml b/tests/dictionaries/80redefine_fillerror/01-base.xml index 7be7528f..626ef87c 100644 --- a/tests/dictionaries/80redefine_fillerror/01-base.xml +++ b/tests/dictionaries/80redefine_fillerror/01-base.xml @@ -1,8 +1,9 @@ - + valeur + mode_conteneur_actif diff --git a/tests/dictionaries/80valid_entier_invalid_param/00-base.xml b/tests/dictionaries/80valid_entier_invalid_param/00-base.xml index feba4a36..3898a551 100644 --- a/tests/dictionaries/80valid_entier_invalid_param/00-base.xml +++ b/tests/dictionaries/80valid_entier_invalid_param/00-base.xml @@ -10,8 +10,9 @@ - + 0 + int diff --git a/tests/dictionaries/80valid_entier_not_number/00-base.xml b/tests/dictionaries/80valid_entier_not_number/00-base.xml index 9c527301..251e87d6 100644 --- a/tests/dictionaries/80valid_entier_not_number/00-base.xml +++ b/tests/dictionaries/80valid_entier_not_number/00-base.xml @@ -10,9 +10,10 @@ - + 0 100 + int diff --git a/tests/dictionaries/80valid_entier_without_param/00-base.xml b/tests/dictionaries/80valid_entier_without_param/00-base.xml index bba116f0..feccef2b 100644 --- a/tests/dictionaries/80valid_entier_without_param/00-base.xml +++ b/tests/dictionaries/80valid_entier_without_param/00-base.xml @@ -10,7 +10,9 @@ - + + int +