From 590283ef2504f5af5d2cef34b0238b71a4729221 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 26 Nov 2019 22:05:28 +0100 Subject: [PATCH] fill is a value --- creole/annotator.py | 18 +++++++++++-- creole/objspace.py | 17 ++++++------- .../01auto_base/result/00-base.xml | 9 +++---- .../01auto_withoutparam/result/00-base.xml | 5 ++-- .../01fill_autofreeze/result/00-base.xml | 9 +++---- .../01fill_autosave/result/00-base.xml | 9 +++---- .../01fill_base/result/00-base.xml | 9 +++---- .../01fill_baseaccent/result/00-base.xml | 9 +++---- .../01fill_context/result/00-base.xml | 11 ++++---- .../01fill_mandatory/result/00-base.xml | 9 +++---- .../01fill_number/result/00-base.xml | 9 +++---- .../01fill_optional/result/00-base.xml | 9 +++---- .../10autosave_hidden/result/00-base.xml | 9 +++---- .../result/00-base.xml | 9 +++---- .../10load_frozenifin_auto/result/00-base.xml | 9 +++---- .../10load_masterslaves/result/00-base.xml | 15 ++++++----- .../result/00-base.xml | 15 ++++++----- .../result/00-base.xml | 15 ++++++----- .../result/00-base.xml | 15 ++++++----- .../10masterslave_multi/result/00-base.xml | 15 ++++++----- .../10masterslaves_append/result/00-base.xml | 15 ++++++----- .../10masterslaves_auto/result/00-base.xml | 21 ++++++++-------- .../result/00-base.xml | 15 ++++++----- .../result/00-base.xml | 9 +++---- .../result/00-base.xml | 15 ++++++----- .../result/00-base.xml | 9 +++---- .../result/00-base.xml | 9 +++---- .../result/00-base.xml | 9 +++---- .../51redefine_auto/result/00-base.xml | 9 +++---- .../51redefine_autofill/result/00-base.xml | 9 +++---- .../51redefine_fill/result/00-base.xml | 9 +++---- .../51redefine_fillauto/result/00-base.xml | 9 +++---- .../60action_external/result/00-base.xml | 9 +++---- .../60extra_help/result/00-base.xml | 15 ++++++----- .../60extra_load/result/00-base.xml | 15 ++++++----- .../60extra_mandatory/result/00-base.xml | 15 ++++++----- .../60extra_redefine/result/00-base.xml | 15 ++++++----- .../70container_disknod/result/00-base.xml | 25 +++++++++---------- tests/test_flattener.py | 4 +-- 39 files changed, 219 insertions(+), 242 deletions(-) diff --git a/creole/annotator.py b/creole/annotator.py index b88bb1dd..f16db7ed 100644 --- a/creole/annotator.py +++ b/creole/annotator.py @@ -484,6 +484,8 @@ class SpaceAnnotator(object): self.filter_separators() self.absolute_path_for_symlink_in_containers() self.convert_helps() + #if hasattr(self.space, 'constraints'): + # print(vars(self.space.constraints)) def absolute_path_for_symlink_in_containers(self): if not hasattr(self.space, 'containers'): @@ -758,7 +760,7 @@ class SpaceAnnotator(object): is_follower = True else: is_follower = False - path = '{}.{}.{}.{}'.format(variables.name, family.name, variable.name, follower.name) + path = '{}.{}.{}'.format(family.path, variable.name, follower.name) self._annotate_variable(follower, family_mode, path, is_follower) if HIGH_COMPATIBILITY: # leader's variable are right @@ -781,7 +783,7 @@ class SpaceAnnotator(object): # auto_freeze's variable is set in 'basic' mode if its mode is 'normal' if variable.auto_freeze is True and variable.mode != modes_level[-1]: variable.mode = modes_level[0] - path = '{}.{}.{}'.format(variables.name, family.name, variable.name) + path = '{}.{}'.format(family.path, variable.name) self._annotate_variable(variable, family_mode, path) def get_variable(self, name): # pylint: disable=C0111 @@ -1103,6 +1105,18 @@ class SpaceAnnotator(object): del_idx.sort(reverse=True) for idx in del_idx: space.constraints.fill.pop(idx) + for fill in space.constraints.fill: + variable = self.paths.get_variable_obj(fill.target) + value = self.objectspace.value() + value.type = 'calculation' + value.name = fill.name + if hasattr(fill, 'param'): + value.param = fill.param + if not hasattr(variable, 'value'): + variable.value = [] + variable.value.append(value) + self.force_not_mandatory.append(fill.target) + del space.constraints.fill def filter_targets(self): # pylint: disable=C0111 for condition_idx, condition in enumerate(self.space.constraints.condition): diff --git a/creole/objspace.py b/creole/objspace.py index 9fee9767..ae39d8de 100644 --- a/creole/objspace.py +++ b/creole/objspace.py @@ -506,7 +506,7 @@ class CreoleObjSpace(object): if not attr.startswith('_'): yield attr - def _sub_xml_export(self, name, node, node_name, space): + def _sub_xml_export(self, name, node, node_name, space, current_space): if isinstance(space, dict): space = list(space.values()) if isinstance(space, list): @@ -533,13 +533,13 @@ class CreoleObjSpace(object): child_node = SubElement(node, name) for subname in self._get_attributes(space): subspace = getattr(space, subname) - self._sub_xml_export(subname, child_node, name, subspace) + self._sub_xml_export(subname, child_node, name, subspace, space) elif isinstance(space, self.Redefinable): child_node = SubElement(node, 'family') child_node.attrib['name'] = name for subname in self._get_attributes(space): subspace = getattr(space, subname) - self._sub_xml_export(subname, child_node, name, subspace) + self._sub_xml_export(subname, child_node, name, subspace, space) else: # FIXME plutot dans annotator ... if name in PROPERTIES and node.tag in ['variable', 'family', 'leader']: @@ -548,7 +548,7 @@ class CreoleObjSpace(object): SubElement(node, 'property').text = prop elif name not in ERASED_ATTRIBUTES: - if name == 'name' and node_name in self.forced_text_elts_as_name: + if name == 'name' and node_name in self.forced_text_elts_as_name and not hasattr(current_space, 'param'): if isinstance(space, str): node.text = space else: @@ -571,7 +571,7 @@ class CreoleObjSpace(object): def _xml_export(self, node, space, node_name='creole'): for name in self._get_attributes(space): subspace = getattr(space, name) - self._sub_xml_export(name, node, node_name, subspace) + self._sub_xml_export(name, node, node_name, subspace, space) class Path(object): @@ -683,10 +683,9 @@ class Path(object): def _get_variable(self, name): if name not in self.variables: if name.startswith('creole.'): - raise CreoleDictConsistencyError( - _("don't set full path variable in creole's namespace " - "(set '{}' not '{}')").format(name.split('.')[-1], name)) - raise CreoleDictConsistencyError(_('unknown option {}').format(name)) + name = name.split('.')[-1] + if name not in self.variables: + raise CreoleDictConsistencyError(_('unknown option {}').format(name)) return self.variables[name] def get_leader(self, name): # pylint: disable=C0111 diff --git a/tests/flattener_dicos/01auto_base/result/00-base.xml b/tests/flattener_dicos/01auto_base/result/00-base.xml index 8a6bdf38..1fe6c98d 100644 --- a/tests/flattener_dicos/01auto_base/result/00-base.xml +++ b/tests/flattener_dicos/01auto_base/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01auto_withoutparam/result/00-base.xml b/tests/flattener_dicos/01auto_withoutparam/result/00-base.xml index ab2ea9b7..c9777ed9 100644 --- a/tests/flattener_dicos/01auto_withoutparam/result/00-base.xml +++ b/tests/flattener_dicos/01auto_withoutparam/result/00-base.xml @@ -1,8 +1,6 @@ - - - + normal @@ -14,6 +12,7 @@ hidden mandatory normal + calc_val oui diff --git a/tests/flattener_dicos/01fill_autofreeze/result/00-base.xml b/tests/flattener_dicos/01fill_autofreeze/result/00-base.xml index 297e3014..0b2dab27 100644 --- a/tests/flattener_dicos/01fill_autofreeze/result/00-base.xml +++ b/tests/flattener_dicos/01fill_autofreeze/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + basic @@ -16,6 +12,9 @@ mandatory basic auto_frozen + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01fill_autosave/result/00-base.xml b/tests/flattener_dicos/01fill_autosave/result/00-base.xml index d1894352..d23f21b2 100644 --- a/tests/flattener_dicos/01fill_autosave/result/00-base.xml +++ b/tests/flattener_dicos/01fill_autosave/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + basic @@ -14,6 +10,9 @@ non mandatory basic + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01fill_base/result/00-base.xml b/tests/flattener_dicos/01fill_base/result/00-base.xml index 8a6bdf38..1fe6c98d 100644 --- a/tests/flattener_dicos/01fill_base/result/00-base.xml +++ b/tests/flattener_dicos/01fill_base/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01fill_baseaccent/result/00-base.xml b/tests/flattener_dicos/01fill_baseaccent/result/00-base.xml index 2451756b..679157e3 100644 --- a/tests/flattener_dicos/01fill_baseaccent/result/00-base.xml +++ b/tests/flattener_dicos/01fill_baseaccent/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01fill_context/result/00-base.xml b/tests/flattener_dicos/01fill_context/result/00-base.xml index 75a97278..ca5b9d3c 100644 --- a/tests/flattener_dicos/01fill_context/result/00-base.xml +++ b/tests/flattener_dicos/01fill_context/result/00-base.xml @@ -1,11 +1,6 @@ - - - creole.general.mode_conteneur_actif - - - + normal @@ -24,6 +19,10 @@ non mandatory normal + + creole.general.mode_conteneur_actif + + diff --git a/tests/flattener_dicos/01fill_mandatory/result/00-base.xml b/tests/flattener_dicos/01fill_mandatory/result/00-base.xml index a8518a94..2d8390e1 100644 --- a/tests/flattener_dicos/01fill_mandatory/result/00-base.xml +++ b/tests/flattener_dicos/01fill_mandatory/result/00-base.xml @@ -1,16 +1,15 @@ - - - creole.general.mode_conteneur_actif1 - - + normal mandatory expert + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/01fill_number/result/00-base.xml b/tests/flattener_dicos/01fill_number/result/00-base.xml index 26908e3b..cfc2e968 100644 --- a/tests/flattener_dicos/01fill_number/result/00-base.xml +++ b/tests/flattener_dicos/01fill_number/result/00-base.xml @@ -1,10 +1,6 @@ - - - 3 - - + normal @@ -13,6 +9,9 @@ frozen hidden normal + + 3 + oui diff --git a/tests/flattener_dicos/01fill_optional/result/00-base.xml b/tests/flattener_dicos/01fill_optional/result/00-base.xml index 8a6bdf38..1fe6c98d 100644 --- a/tests/flattener_dicos/01fill_optional/result/00-base.xml +++ b/tests/flattener_dicos/01fill_optional/result/00-base.xml @@ -1,10 +1,6 @@ - - - creole.general.mode_conteneur_actif1 - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + creole.general.mode_conteneur_actif1 + oui diff --git a/tests/flattener_dicos/10autosave_hidden/result/00-base.xml b/tests/flattener_dicos/10autosave_hidden/result/00-base.xml index bd05adbd..3e85188e 100644 --- a/tests/flattener_dicos/10autosave_hidden/result/00-base.xml +++ b/tests/flattener_dicos/10autosave_hidden/result/00-base.xml @@ -1,10 +1,6 @@ - - - oui - - + basic @@ -23,6 +19,9 @@ frozen hidden basic + + oui + diff --git a/tests/flattener_dicos/10autosave_hidden_frozenifin/result/00-base.xml b/tests/flattener_dicos/10autosave_hidden_frozenifin/result/00-base.xml index f2c44471..345adf14 100644 --- a/tests/flattener_dicos/10autosave_hidden_frozenifin/result/00-base.xml +++ b/tests/flattener_dicos/10autosave_hidden_frozenifin/result/00-base.xml @@ -1,10 +1,6 @@ - - - oui - - + basic @@ -24,6 +20,9 @@ frozen hidden force_default_on_freeze + + oui + diff --git a/tests/flattener_dicos/10load_frozenifin_auto/result/00-base.xml b/tests/flattener_dicos/10load_frozenifin_auto/result/00-base.xml index 1b11a8a2..db4fae95 100644 --- a/tests/flattener_dicos/10load_frozenifin_auto/result/00-base.xml +++ b/tests/flattener_dicos/10load_frozenifin_auto/result/00-base.xml @@ -1,10 +1,6 @@ - - - non - - + normal @@ -23,6 +19,9 @@ frozen hidden force_default_on_freeze + + non + oui diff --git a/tests/flattener_dicos/10load_masterslaves/result/00-base.xml b/tests/flattener_dicos/10load_masterslaves/result/00-base.xml index 08aa929b..c1967d8d 100644 --- a/tests/flattener_dicos/10load_masterslaves/result/00-base.xml +++ b/tests/flattener_dicos/10load_masterslaves/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general1.master.slave1 - - + normal @@ -26,9 +19,15 @@ normal + + valfill + normal + + creole.general1.master.slave1 + diff --git a/tests/flattener_dicos/10masterslave_autosaveexpert/result/00-base.xml b/tests/flattener_dicos/10masterslave_autosaveexpert/result/00-base.xml index 08467004..9c3e5855 100644 --- a/tests/flattener_dicos/10masterslave_autosaveexpert/result/00-base.xml +++ b/tests/flattener_dicos/10masterslave_autosaveexpert/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general.master.slave1 - - + normal @@ -23,9 +16,15 @@ normal + + valfill + expert + + creole.general.master.slave1 + diff --git a/tests/flattener_dicos/10masterslave_mandatory/result/00-base.xml b/tests/flattener_dicos/10masterslave_mandatory/result/00-base.xml index 0b255b83..39781ec2 100644 --- a/tests/flattener_dicos/10masterslave_mandatory/result/00-base.xml +++ b/tests/flattener_dicos/10masterslave_mandatory/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general.master.slave1 - - + normal @@ -24,9 +17,15 @@ mandatory normal + + valfill + normal + + creole.general.master.slave1 + diff --git a/tests/flattener_dicos/10masterslave_mastermandatory/result/00-base.xml b/tests/flattener_dicos/10masterslave_mastermandatory/result/00-base.xml index 1da4e93b..532fb64a 100644 --- a/tests/flattener_dicos/10masterslave_mastermandatory/result/00-base.xml +++ b/tests/flattener_dicos/10masterslave_mastermandatory/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general.master.slave1 - - + basic @@ -25,9 +18,15 @@ normal + + valfill + normal + + creole.general.master.slave1 + diff --git a/tests/flattener_dicos/10masterslave_multi/result/00-base.xml b/tests/flattener_dicos/10masterslave_multi/result/00-base.xml index c0450acd..7053a6fb 100644 --- a/tests/flattener_dicos/10masterslave_multi/result/00-base.xml +++ b/tests/flattener_dicos/10masterslave_multi/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general1.master.slave1 - - + normal @@ -26,9 +19,15 @@ normal + + valfill + normal + + creole.general1.master.slave1 + diff --git a/tests/flattener_dicos/10masterslaves_append/result/00-base.xml b/tests/flattener_dicos/10masterslaves_append/result/00-base.xml index 83f3edcd..db3115ca 100644 --- a/tests/flattener_dicos/10masterslaves_append/result/00-base.xml +++ b/tests/flattener_dicos/10masterslaves_append/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general1.master.slave1 - - + normal @@ -26,9 +19,15 @@ normal + + valfill + normal + + creole.general1.master.slave1 + normal diff --git a/tests/flattener_dicos/10masterslaves_auto/result/00-base.xml b/tests/flattener_dicos/10masterslaves_auto/result/00-base.xml index 827e0db8..83e72bad 100644 --- a/tests/flattener_dicos/10masterslaves_auto/result/00-base.xml +++ b/tests/flattener_dicos/10masterslaves_auto/result/00-base.xml @@ -1,16 +1,6 @@ - - - valfill - - - creole.general.master.slave1 - - - creole.general.master.master - - + normal @@ -29,18 +19,27 @@ frozen hidden normal + + valfill + force_default_on_freeze frozen hidden normal + + creole.general.master.slave1 + force_default_on_freeze frozen hidden normal + + creole.general.master.master + diff --git a/tests/flattener_dicos/10masterslaves_automaster/result/00-base.xml b/tests/flattener_dicos/10masterslaves_automaster/result/00-base.xml index c1d158f0..ac787a61 100644 --- a/tests/flattener_dicos/10masterslaves_automaster/result/00-base.xml +++ b/tests/flattener_dicos/10masterslaves_automaster/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general.master.master - - + normal @@ -26,12 +19,18 @@ frozen hidden normal + + valfill + force_default_on_freeze frozen hidden normal + + creole.general.master.master + diff --git a/tests/flattener_dicos/10masterslaves_automaster_expert/result/00-base.xml b/tests/flattener_dicos/10masterslaves_automaster_expert/result/00-base.xml index 360c7da2..4eecad74 100644 --- a/tests/flattener_dicos/10masterslaves_automaster_expert/result/00-base.xml +++ b/tests/flattener_dicos/10masterslaves_automaster_expert/result/00-base.xml @@ -1,10 +1,6 @@ - - - valfill - - + expert @@ -24,6 +20,9 @@ force_default_on_freeze frozen + + valfill + expert diff --git a/tests/flattener_dicos/10masterslaves_familyaccent/result/00-base.xml b/tests/flattener_dicos/10masterslaves_familyaccent/result/00-base.xml index 6e5279ca..1073a8d0 100644 --- a/tests/flattener_dicos/10masterslaves_familyaccent/result/00-base.xml +++ b/tests/flattener_dicos/10masterslaves_familyaccent/result/00-base.xml @@ -1,13 +1,6 @@ - - - valfill - - - creole.general.master.slave1 - - + normal @@ -23,9 +16,15 @@ normal + + valfill + normal + + creole.general.master.slave1 + diff --git a/tests/flattener_dicos/30mandatory_withoutvaluecalc/result/00-base.xml b/tests/flattener_dicos/30mandatory_withoutvaluecalc/result/00-base.xml index af6502d9..4d9c0d83 100644 --- a/tests/flattener_dicos/30mandatory_withoutvaluecalc/result/00-base.xml +++ b/tests/flattener_dicos/30mandatory_withoutvaluecalc/result/00-base.xml @@ -1,10 +1,6 @@ - - - value - - + normal @@ -13,6 +9,9 @@ frozen hidden normal + + value + diff --git a/tests/flattener_dicos/30mandatory_withvaluecalc/result/00-base.xml b/tests/flattener_dicos/30mandatory_withvaluecalc/result/00-base.xml index 623573f4..05b9531a 100644 --- a/tests/flattener_dicos/30mandatory_withvaluecalc/result/00-base.xml +++ b/tests/flattener_dicos/30mandatory_withvaluecalc/result/00-base.xml @@ -1,15 +1,14 @@ - - - value - - + normal normal + + value + diff --git a/tests/flattener_dicos/40ifin_masterslavesauto/result/00-base.xml b/tests/flattener_dicos/40ifin_masterslavesauto/result/00-base.xml index 15fee664..70af7e56 100644 --- a/tests/flattener_dicos/40ifin_masterslavesauto/result/00-base.xml +++ b/tests/flattener_dicos/40ifin_masterslavesauto/result/00-base.xml @@ -1,10 +1,6 @@ - - - valfill - - + normal @@ -31,6 +27,9 @@ hidden normal disabled + + valfill + normal diff --git a/tests/flattener_dicos/51redefine_auto/result/00-base.xml b/tests/flattener_dicos/51redefine_auto/result/00-base.xml index cce7635e..5a80ad8f 100644 --- a/tests/flattener_dicos/51redefine_auto/result/00-base.xml +++ b/tests/flattener_dicos/51redefine_auto/result/00-base.xml @@ -1,10 +1,6 @@ - - - non - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + non + diff --git a/tests/flattener_dicos/51redefine_autofill/result/00-base.xml b/tests/flattener_dicos/51redefine_autofill/result/00-base.xml index 08216a1c..5b90cbee 100644 --- a/tests/flattener_dicos/51redefine_autofill/result/00-base.xml +++ b/tests/flattener_dicos/51redefine_autofill/result/00-base.xml @@ -1,10 +1,6 @@ - - - non - - + normal @@ -13,6 +9,9 @@ non mandatory normal + + non + diff --git a/tests/flattener_dicos/51redefine_fill/result/00-base.xml b/tests/flattener_dicos/51redefine_fill/result/00-base.xml index cce7635e..5a80ad8f 100644 --- a/tests/flattener_dicos/51redefine_fill/result/00-base.xml +++ b/tests/flattener_dicos/51redefine_fill/result/00-base.xml @@ -1,10 +1,6 @@ - - - non - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + non + diff --git a/tests/flattener_dicos/51redefine_fillauto/result/00-base.xml b/tests/flattener_dicos/51redefine_fillauto/result/00-base.xml index cce7635e..5a80ad8f 100644 --- a/tests/flattener_dicos/51redefine_fillauto/result/00-base.xml +++ b/tests/flattener_dicos/51redefine_fillauto/result/00-base.xml @@ -1,10 +1,6 @@ - - - non - - + normal @@ -16,6 +12,9 @@ hidden mandatory normal + + non + diff --git a/tests/flattener_dicos/60action_external/result/00-base.xml b/tests/flattener_dicos/60action_external/result/00-base.xml index f98e47ca..ce906790 100644 --- a/tests/flattener_dicos/60action_external/result/00-base.xml +++ b/tests/flattener_dicos/60action_external/result/00-base.xml @@ -57,11 +57,7 @@ - - - http://localhost/ - - + normal @@ -91,6 +87,9 @@ frozen hidden normal + + http://localhost/ + diff --git a/tests/flattener_dicos/60extra_help/result/00-base.xml b/tests/flattener_dicos/60extra_help/result/00-base.xml index 06e38932..5d3f3cf1 100644 --- a/tests/flattener_dicos/60extra_help/result/00-base.xml +++ b/tests/flattener_dicos/60extra_help/result/00-base.xml @@ -1,13 +1,6 @@ - - - non - creole.general.activer_ejabberd - none - daily - - + normal @@ -49,6 +42,12 @@ monthly mandatory normal + + non + creole.general.activer_ejabberd + none + daily + pre diff --git a/tests/flattener_dicos/60extra_load/result/00-base.xml b/tests/flattener_dicos/60extra_load/result/00-base.xml index 58b181af..109949f1 100644 --- a/tests/flattener_dicos/60extra_load/result/00-base.xml +++ b/tests/flattener_dicos/60extra_load/result/00-base.xml @@ -1,13 +1,6 @@ - - - non - creole.general.activer_ejabberd - none - daily - - + normal @@ -49,6 +42,12 @@ monthly mandatory normal + + non + creole.general.activer_ejabberd + none + daily + pre diff --git a/tests/flattener_dicos/60extra_mandatory/result/00-base.xml b/tests/flattener_dicos/60extra_mandatory/result/00-base.xml index 05b48a21..876b838f 100644 --- a/tests/flattener_dicos/60extra_mandatory/result/00-base.xml +++ b/tests/flattener_dicos/60extra_mandatory/result/00-base.xml @@ -1,13 +1,6 @@ - - - non - creole.general.activer_ejabberd - none - daily - - + normal @@ -49,6 +42,12 @@ monthly mandatory normal + + non + creole.general.activer_ejabberd + none + daily + pre diff --git a/tests/flattener_dicos/60extra_redefine/result/00-base.xml b/tests/flattener_dicos/60extra_redefine/result/00-base.xml index c4b8b1b8..cdc4d3c6 100644 --- a/tests/flattener_dicos/60extra_redefine/result/00-base.xml +++ b/tests/flattener_dicos/60extra_redefine/result/00-base.xml @@ -1,13 +1,6 @@ - - - non - creole.general.activer_ejabberd - none - daily - - + normal @@ -52,6 +45,12 @@ monthly mandatory normal + + non + creole.general.activer_ejabberd + none + daily + pre diff --git a/tests/flattener_dicos/70container_disknod/result/00-base.xml b/tests/flattener_dicos/70container_disknod/result/00-base.xml index dafc9fd3..bd79223d 100644 --- a/tests/flattener_dicos/70container_disknod/result/00-base.xml +++ b/tests/flattener_dicos/70container_disknod/result/00-base.xml @@ -1,18 +1,6 @@ - - - minor - /etc/mailname' - - - major - /etc/mailname' - - - /etc/mailname' - - + @@ -21,11 +9,19 @@ force_default_on_freeze frozen hidden + + major + /etc/mailname' + force_default_on_freeze frozen hidden + + minor + /etc/mailname' + rwm @@ -40,6 +36,9 @@ force_default_on_freeze frozen hidden + + /etc/mailname' + diff --git a/tests/test_flattener.py b/tests/test_flattener.py index 8277ad78..68fb8abb 100644 --- a/tests/test_flattener.py +++ b/tests/test_flattener.py @@ -30,7 +30,7 @@ for test in listdir(dico_dirs): excludes = set([]) test_ok -= excludes test_raise -= excludes -# test_ok = ['70container_serviceaccesslist_servicelist'] +# test_ok = ['10autosave_hidden'] # test_raise = [] @@ -85,7 +85,7 @@ def launch_flattener(test_dir): eolobj.save(destfile) result_file = join(test_dir, 'result/00-base.xml') if isfile(result_file): - # eolobj.save(result_file) + eolobj.save(result_file) compare_xml(destfile, result_file)