From 8f7fa59333d892fce205230512c0bba5f5f084ae Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 4 Aug 2020 16:50:45 +0200 Subject: [PATCH] add mandatory properties is more conveniant --- src/rougail/annotator.py | 53 +++++++++++-------- src/rougail/tiramisureflector.py | 6 ++- .../10leadership_append/tiramisu/base.py | 2 +- .../10leadership_auto/tiramisu/base.py | 4 +- .../10leadership_autoleader/tiramisu/base.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/base.py | 4 +- .../10leadership_mandatory/tiramisu/base.py | 2 +- .../10leadership_multi/tiramisu/base.py | 2 +- .../10load_leadership/tiramisu/base.py | 2 +- .../tiramisu/base.py | 2 +- .../tiramisu/base.py | 2 +- .../20family_dynamic_calc/tiramisu/base.py | 2 +- .../20family_dynamic_number/tiramisu/base.py | 2 +- 15 files changed, 49 insertions(+), 40 deletions(-) diff --git a/src/rougail/annotator.py b/src/rougail/annotator.py index f02bd5569..5e527dbd1 100644 --- a/src/rougail/annotator.py +++ b/src/rougail/annotator.py @@ -75,17 +75,13 @@ class SpaceAnnotator: """ def __init__(self, objectspace, eosfunc_file): self.objectspace = objectspace - self.force_not_mandatory = [] GroupAnnotator(objectspace) ServiceAnnotator(objectspace) VariableAnnotator(objectspace) ConstraintAnnotator(objectspace, eosfunc_file, - self.force_not_mandatory, ) - FamilyAnnotator(objectspace, - self.force_not_mandatory, - ) + FamilyAnnotator(objectspace) PropertyAnnotator(objectspace) @@ -597,14 +593,12 @@ class ConstraintAnnotator: def __init__(self, objectspace, eosfunc_file, - force_not_mandatory, ): if not hasattr(objectspace.space, 'constraints'): return self.objectspace = objectspace self.eosfunc = imp.load_source('eosfunc', eosfunc_file) self.valid_enums = {} - self.force_not_mandatory = force_not_mandatory if hasattr(self.objectspace.space.constraints, 'check'): self.check_check() self.check_replace_text() @@ -974,7 +968,6 @@ class ConstraintAnnotator: if param.name == 'mini': variable.min_number = int(param.text) elif param.name == 'maxi': - print('pppp', param.text) variable.max_number = int(param.text) else: raise DictConsistencyError(_(f'unknown parameter {param.text} in check "valid_entier" for variable {check.target}')) @@ -1074,9 +1067,10 @@ class ConstraintAnnotator: class FamilyAnnotator: - def __init__(self, objectspace, force_not_mandatory): + def __init__(self, + objectspace, + ): self.objectspace = objectspace - self.force_not_mandatory = force_not_mandatory self.remove_empty_families() self.change_variable_mode() self.change_family_mode() @@ -1126,23 +1120,36 @@ class FamilyAnnotator: def annotate_variable(self, variable, family_mode, path, is_follower=False): # if the variable is mandatory and doesn't have any value # then the variable's mode is set to 'basic' - has_value = hasattr(variable, 'value') - if variable.mandatory is True and (not has_value or is_follower): - variable.mode = modes_level[0] - if variable.mode != None and modes[variable.mode] < modes[family_mode] and (not is_follower or variable.mode != modes_level[0]): - variable.mode = family_mode - if has_value and path not in self.force_not_mandatory: - variable.mandatory = True - if variable.hidden is True: - variable.frozen = True - if not variable.auto_save is True and 'force_default_on_freeze' not in vars(variable): - variable.force_default_on_freeze = True - if not has_value and variable.type == 'boolean': + if not hasattr(variable, 'value') and variable.type == 'boolean': new_value = self.objectspace.value() new_value.name = True new_value.type = 'boolean' variable.value = [new_value] - variable.mandatory = True + if hasattr(variable, 'value') and variable.value: + has_value = True + for value in variable.value: + if value.type == 'calculation': + has_value = False + has_variable = False + if hasattr(value, 'param'): + for param in value.param: + if param.type == 'variable': + has_variable = True + break + if not has_variable: + # if one parameter is a variable, let variable choice if it's mandatory + variable.mandatory = True + if has_value: + # if has value but without any calculation + variable.mandatory = True + if variable.mandatory is True and (not hasattr(variable, 'value') or is_follower): + variable.mode = modes_level[0] + if variable.mode != None and modes[variable.mode] < modes[family_mode] and (not is_follower or variable.mode != modes_level[0]): + variable.mode = family_mode + if variable.hidden is True: + variable.frozen = True + if not variable.auto_save is True and 'force_default_on_freeze' not in vars(variable): + variable.force_default_on_freeze = True def change_variable_mode(self): # pylint: disable=C0111 if not hasattr(self.objectspace.space, 'variables'): diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index f408aff22..a0d821ad7 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -337,8 +337,10 @@ class Variable(Common): for key in self.get_attributes(self.elt): value = getattr(self.elt, key) if key in FORCE_INFORMATIONS: - if key == 'test' and self.object_type == 'IntOption': - value = int(value) + if key == 'test': + value = value.split(',') + if self.object_type == 'IntOption': + value = [int(v) for v in value] self.informations[key] = value else: self.attrib[key] = value diff --git a/tests/flattener_dicos/10leadership_append/tiramisu/base.py b/tests/flattener_dicos/10leadership_append/tiramisu/base.py index 871dce92e..031afd311 100644 --- a/tests/flattener_dicos/10leadership_append/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_append/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mod option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_6 = StrOption(name='leader', doc='leader', multi=True) option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_8 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_8 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) option_9 = StrOption(properties=frozenset({'normal'}), name='follower3', doc='follower3', multi=True) option_5 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_6, option_7, option_8, option_9]) option_4 = OptionDescription(name='general1', doc='general1', properties=frozenset({'normal'}), children=[option_5]) diff --git a/tests/flattener_dicos/10leadership_auto/tiramisu/base.py b/tests/flattener_dicos/10leadership_auto/tiramisu/base.py index 287a62e44..5f95d40d0 100644 --- a/tests/flattener_dicos/10leadership_auto/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_auto/tiramisu/base.py @@ -5,8 +5,8 @@ func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(name='leader', doc='leader', multi=True) option_6 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) -option_8 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='follower3', doc='follower3', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_8 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'normal'}), name='follower3', doc='follower3', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_5, option_6, option_7, option_8]) option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_autoleader/tiramisu/base.py b/tests/flattener_dicos/10leadership_autoleader/tiramisu/base.py index 8c83821c4..b8c12fbb7 100644 --- a/tests/flattener_dicos/10leadership_autoleader/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_autoleader/tiramisu/base.py @@ -5,7 +5,7 @@ func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(name='leader', doc='leader', multi=True) option_6 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_5, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_5, option_6, option_7]) option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_autosaveexpert/tiramisu/base.py b/tests/flattener_dicos/10leadership_autosaveexpert/tiramisu/base.py index 9921b16e3..902d56e03 100644 --- a/tests/flattener_dicos/10leadership_autosaveexpert/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_autosaveexpert/tiramisu/base.py @@ -5,7 +5,7 @@ func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(name='leader', doc='leader', multi=True) option_6 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'expert', 'mandatory'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'expert'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_5, option_6, option_7]) option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_familyaccent/tiramisu/base.py b/tests/flattener_dicos/10leadership_familyaccent/tiramisu/base.py index 042a4e16c..e29749715 100644 --- a/tests/flattener_dicos/10leadership_familyaccent/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_familyaccent/tiramisu/base.py @@ -5,7 +5,7 @@ func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(name='leader', doc='leader', multi=True) option_6 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_5, option_6, option_7]) option_2 = OptionDescription(name='general', doc='Général', properties=frozenset({'normal'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_leadermandatory/tiramisu/base.py b/tests/flattener_dicos/10leadership_leadermandatory/tiramisu/base.py index 7a6a493ff..9aecedf3a 100644 --- a/tests/flattener_dicos/10leadership_leadermandatory/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_leadermandatory/tiramisu/base.py @@ -4,8 +4,8 @@ import imp func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(properties=frozenset({'mandatory'}), name='leader', doc='leader', multi=True) -option_6 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_6 = StrOption(properties=frozenset({'basic', 'mandatory'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) +option_7 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'basic'}), children=[option_5, option_6, option_7]) option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'basic'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_mandatory/tiramisu/base.py b/tests/flattener_dicos/10leadership_mandatory/tiramisu/base.py index 6784aa3d1..74d1555fe 100644 --- a/tests/flattener_dicos/10leadership_mandatory/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_mandatory/tiramisu/base.py @@ -5,7 +5,7 @@ func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non')) option_5 = StrOption(name='leader', doc='leader', multi=True) option_6 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_6, notraisepropertyerror=False, todict=False)), kwargs={}))) option_4 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_5, option_6, option_7]) option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3, option_4]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2]) diff --git a/tests/flattener_dicos/10leadership_multi/tiramisu/base.py b/tests/flattener_dicos/10leadership_multi/tiramisu/base.py index 132a14b0f..7e92cabd5 100644 --- a/tests/flattener_dicos/10leadership_multi/tiramisu/base.py +++ b/tests/flattener_dicos/10leadership_multi/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mod option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_6 = StrOption(name='leader', doc='leader', multi=True) option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_8 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_8 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) option_5 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_6, option_7, option_8]) option_10 = StrOption(name='leader1', doc='leader', multi=True) option_11 = StrOption(properties=frozenset({'normal'}), name='follower11', doc='follower1', multi=True) diff --git a/tests/flattener_dicos/10load_leadership/tiramisu/base.py b/tests/flattener_dicos/10load_leadership/tiramisu/base.py index 5e1492a4c..3e65f4942 100644 --- a/tests/flattener_dicos/10load_leadership/tiramisu/base.py +++ b/tests/flattener_dicos/10load_leadership/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mod option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_6 = StrOption(name='leader', doc='leader', multi=True) option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_8 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_8 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) option_5 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_6, option_7, option_8]) option_4 = OptionDescription(name='general1', doc='general1', properties=frozenset({'normal'}), children=[option_5]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2, option_4]) diff --git a/tests/flattener_dicos/10load_leadership_description/tiramisu/base.py b/tests/flattener_dicos/10load_leadership_description/tiramisu/base.py index 0504ad75a..a7a108bbe 100644 --- a/tests/flattener_dicos/10load_leadership_description/tiramisu/base.py +++ b/tests/flattener_dicos/10load_leadership_description/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mod option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_6 = StrOption(name='leader', doc='leader', multi=True) option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_8 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_8 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=True, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={}))) option_5 = Leadership(name='leader', doc='other description', properties=frozenset({'normal'}), children=[option_6, option_7, option_8]) option_4 = OptionDescription(name='general1', doc='general1', properties=frozenset({'normal'}), children=[option_5]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2, option_4]) diff --git a/tests/flattener_dicos/10load_leadership_submulti/tiramisu/base.py b/tests/flattener_dicos/10load_leadership_submulti/tiramisu/base.py index e72e3459f..198cf4439 100644 --- a/tests/flattener_dicos/10load_leadership_submulti/tiramisu/base.py +++ b/tests/flattener_dicos/10load_leadership_submulti/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = ChoiceOption(properties=frozenset({'mandatory', 'normal'}), name='mod option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_6 = StrOption(name='leader', doc='leader', multi=True) option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower1', doc='follower1', multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")}))) -option_8 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='follower2', doc='follower2', multi=submulti, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={})), default_multi=[]) +option_8 = StrOption(properties=frozenset({'normal'}), name='follower2', doc='follower2', multi=submulti, default=Calculation(func.calc_val, Params((ParamOption(option_7, notraisepropertyerror=False, todict=False)), kwargs={})), default_multi=[]) option_5 = Leadership(name='leader', doc='leader', properties=frozenset({'normal'}), children=[option_6, option_7, option_8]) option_4 = OptionDescription(name='general1', doc='general1', properties=frozenset({'normal'}), children=[option_5]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2, option_4]) diff --git a/tests/flattener_dicos/20family_dynamic_calc/tiramisu/base.py b/tests/flattener_dicos/20family_dynamic_calc/tiramisu/base.py index da389eaff..5f7e13a9d 100644 --- a/tests/flattener_dicos/20family_dynamic_calc/tiramisu/base.py +++ b/tests/flattener_dicos/20family_dynamic_calc/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='varnam option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_5 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='vardyn', doc='No change', multi=False, default='val') option_4 = ConvertDynOptionDescription(name='dyn', doc='dyn', suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), properties=frozenset({'normal'}), children=[option_5]) -option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='newvar', doc='No change', multi=False, default=Calculation(func.calc_val, Params((ParamDynOption(option_5, 'val1', option_4, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'normal'}), name='newvar', doc='No change', multi=False, default=Calculation(func.calc_val, Params((ParamDynOption(option_5, 'val1', option_4, notraisepropertyerror=False, todict=False)), kwargs={}))) option_6 = OptionDescription(name='new', doc='new', properties=frozenset({'normal'}), children=[option_7]) 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/flattener_dicos/20family_dynamic_number/tiramisu/base.py b/tests/flattener_dicos/20family_dynamic_number/tiramisu/base.py index 05bb40801..0f461578e 100644 --- a/tests/flattener_dicos/20family_dynamic_number/tiramisu/base.py +++ b/tests/flattener_dicos/20family_dynamic_number/tiramisu/base.py @@ -6,7 +6,7 @@ option_3 = IntOption(properties=frozenset({'mandatory', 'normal'}), name='varnam option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3]) option_5 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='vardyn', doc='No change', multi=False, default='val') option_4 = ConvertDynOptionDescription(name='dyn', doc='dyn', suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), properties=frozenset({'normal'}), children=[option_5]) -option_7 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='newvar', doc='No change', multi=False, default=Calculation(func.calc_val, Params((ParamDynOption(option_5, '1', option_4, notraisepropertyerror=False, todict=False)), kwargs={}))) +option_7 = StrOption(properties=frozenset({'normal'}), name='newvar', doc='No change', multi=False, default=Calculation(func.calc_val, Params((ParamDynOption(option_5, '1', option_4, notraisepropertyerror=False, todict=False)), kwargs={}))) option_6 = OptionDescription(name='new', doc='new', properties=frozenset({'normal'}), children=[option_7]) option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2, option_4, option_6]) option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])