diff --git a/src/rougail/annotator/condition.py b/src/rougail/annotator/condition.py index 6abad827..14c2ece9 100644 --- a/src/rougail/annotator/condition.py +++ b/src/rougail/annotator/condition.py @@ -250,6 +250,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk): param3.name = f'condition_{fill.index}' param3.type = 'variable' param3.text = condition.source.path + param3.propertyerror = False fill.param.append(param3) param4 = self.objectspace.param(target.xmlfiles) param4.name = f'expected_{fill.index}' diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py index 9df307eb..d52b30b7 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py index 1b8a08c1..d1247ffa 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py index 3330ca68..163d7bc3 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py index 089d269f..db26c7d4 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py index 9822c077..cb1ba8f8 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py index 9823a059..458930f2 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py index 9605eec2..3abc58ac 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py index add634a6..c867565c 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/etc/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("oui")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py index 886e0b0e..acf353d6 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py @@ -21,7 +21,7 @@ option_11 = StrOption(name="mode", doc="mode", default="0644") option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_13 = StrOption(name="owner", doc="owner", default="root") option_14 = StrOption(name="source", doc="source", default="file1") -option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(True)}))) +option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) option_6 = OptionDescription(name="files", doc="files", children=[option_7]) option_16 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py index 85c4017b..d44a6fbc 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py @@ -21,7 +21,7 @@ option_11 = StrOption(name="mode", doc="mode", default="0644") option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_13 = StrOption(name="owner", doc="owner", default="root") option_14 = StrOption(name="source", doc="source", default="file1") -option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(True)}))) +option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) option_6 = OptionDescription(name="files", doc="files", children=[option_7]) option_16 = BoolOption(name="activate", doc="activate", default=True) 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 cd687323..8e122af1 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/etc/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("oui")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) 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 90d94571..4bd9cc16 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("oui")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_19 = StrOption(name="engine", doc="engine", default="creole") option_20 = StrOption(name="group", doc="group", default="root") @@ -32,7 +32,7 @@ option_22 = StrOption(name="mode", doc="mode", default="0644") option_23 = FilenameOption(name="name", doc="name", default="/tmp/file2") option_24 = StrOption(name="owner", doc="owner", default="root") option_25 = StrOption(name="source", doc="source", default="file2") -option_26 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("oui")}))) +option_26 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) option_18 = OptionDescription(name="file2", doc="file2", children=[option_19, option_20, option_21, option_22, option_23, option_24, option_25, option_26]) option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_18]) option_27 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py index 60c349da..158e1708 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py index 60c349da..158e1708 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py index 41408f0f..db0d3b12 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py index 4c08cfca..9bdaaa29 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py @@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_15 = StrOption(name="owner", doc="owner", default="root") option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) +option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) option_8 = OptionDescription(name="files", doc="files", children=[option_9]) option_18 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/70service_servicelist/tiramisu/base.py b/tests/dictionaries/70service_servicelist/tiramisu/base.py index 51dee229..ef89c05e 100644 --- a/tests/dictionaries/70service_servicelist/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")}))) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) option_6 = BoolOption(name="manage", doc="manage", default=True) option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_6]) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/00-base.xml b/tests/dictionaries/70service_servicelist_disabled_if_in/00-base.xml new file mode 100644 index 00000000..0e21a232 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/00-base.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + no + + + no + + + + + no + condition2 + + + yes + test + + + + diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/__init__.py b/tests/dictionaries/70service_servicelist_disabled_if_in/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/after.json b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/after.json new file mode 100644 index 00000000..2eba5258 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/after.json @@ -0,0 +1,14 @@ +{ + "rougail.condition1": { + "owner": "default", + "value": "no" + }, + "services.test.activate": { + "owner": "default", + "value": false + }, + "services.test.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/base.json b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/base.json new file mode 100644 index 00000000..e97d9ea7 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/base.json @@ -0,0 +1,5 @@ +{ + "rougail.condition1": "no", + "services.test.activate": false, + "services.test.manage": true +} diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/before.json b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/before.json new file mode 100644 index 00000000..2eba5258 --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/makedict/before.json @@ -0,0 +1,14 @@ +{ + "rougail.condition1": { + "owner": "default", + "value": "no" + }, + "services.test.activate": { + "owner": "default", + "value": false + }, + "services.test.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py new file mode 100644 index 00000000..3bbe733f --- /dev/null +++ b/tests/dictionaries/70service_servicelist_disabled_if_in/tiramisu/base.py @@ -0,0 +1,21 @@ +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 * +option_2 = StrOption(name="condition1", doc="condition1", default="no", properties=frozenset({"mandatory", "normal"})) +option_3 = StrOption(name="condition2", doc="condition2", default="no", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("no")}))})) +option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) +option_6 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) +option_7 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_7]) +option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py index 2709b532..fa6bc7f2 100644 --- a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py @@ -24,7 +24,7 @@ option_14 = StrOption(name="source", doc="source", default="file") option_15 = BoolOption(name="activate", doc="activate", default=True) option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("no")}))) +option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) option_17 = BoolOption(name="manage", doc="manage", default=True) option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) diff --git a/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py b/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py index 26cbfc85..c0e08ca4 100644 --- a/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_ip/tiramisu/base.py @@ -18,7 +18,7 @@ option_8 = SymLinkOption(name="name", opt=option_3) option_9 = BoolOption(name="activate", doc="activate", default=True) option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) -option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("no")}))) +option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) option_11 = BoolOption(name="manage", doc="manage", default=True) option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) diff --git a/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py index dc47598e..86622e84 100644 --- a/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_not_managed/tiramisu/base.py @@ -13,7 +13,7 @@ except: from tiramisu import * option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")}))) +option_5 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) option_6 = BoolOption(name="manage", doc="manage", default=False) option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_6]) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) diff --git a/tests/dictionaries/70services_ip_iplist/tiramisu/base.py b/tests/dictionaries/70services_ip_iplist/tiramisu/base.py index 0c6b84fc..d2f61d0e 100644 --- a/tests/dictionaries/70services_ip_iplist/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_iplist/tiramisu/base.py @@ -15,7 +15,7 @@ option_2 = StrOption(name="condition", doc="condition", default="no", properties option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")}))})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")}))) +option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) option_10 = BoolOption(name="activate", doc="activate", default=True) diff --git a/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py b/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py index de18fcf7..2473f86a 100644 --- a/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py +++ b/tests/dictionaries/70services_ip_iplist2/tiramisu/base.py @@ -15,7 +15,7 @@ option_2 = StrOption(name="condition", doc="condition", default="yes", propertie option_3 = NetworkOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.0/24", cidr=True, properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) option_8 = SymLinkOption(name="name", opt=option_3) -option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2), 'expected_0': ParamValue("yes")}))) +option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("yes")}))) option_7 = OptionDescription(name="nut_monitor_host", doc="nut_monitor_host", children=[option_8, option_9]) option_6 = OptionDescription(name="ip", doc="ip", children=[option_7]) option_10 = BoolOption(name="activate", doc="activate", default=True)