activate with disabled variable

This commit is contained in:
Emmanuel Garette 2021-02-27 18:07:03 +01:00
parent 83156863da
commit f4538004c7
29 changed files with 107 additions and 23 deletions

View file

@ -250,6 +250,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
param3.name = f'condition_{fill.index}' param3.name = f'condition_{fill.index}'
param3.type = 'variable' param3.type = 'variable'
param3.text = condition.source.path param3.text = condition.source.path
param3.propertyerror = False
fill.param.append(param3) fill.param.append(param3)
param4 = self.objectspace.param(target.xmlfiles) param4 = self.objectspace.param(target.xmlfiles)
param4.name = f'expected_{fill.index}' param4.name = f'expected_{fill.index}'

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/etc/file") option_14 = FilenameOption(name="name", doc="name", default="/etc/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -21,7 +21,7 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_13 = StrOption(name="owner", doc="owner", default="root") option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file1") 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_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_6 = OptionDescription(name="files", doc="files", children=[option_7])
option_16 = BoolOption(name="activate", doc="activate", default=True) option_16 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -21,7 +21,7 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_13 = StrOption(name="owner", doc="owner", default="root") option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file1") 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_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_6 = OptionDescription(name="files", doc="files", children=[option_7])
option_16 = BoolOption(name="activate", doc="activate", default=True) option_16 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/etc/file") option_14 = FilenameOption(name="name", doc="name", default="/etc/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file1") 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_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_19 = StrOption(name="engine", doc="engine", default="creole")
option_20 = StrOption(name="group", doc="group", default="root") 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_23 = FilenameOption(name="name", doc="name", default="/tmp/file2")
option_24 = StrOption(name="owner", doc="owner", default="root") option_24 = StrOption(name="owner", doc="owner", default="root")
option_25 = StrOption(name="source", doc="source", default="file2") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9, option_18])
option_27 = BoolOption(name="activate", doc="activate", default=True) option_27 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -23,7 +23,7 @@ option_13 = StrOption(name="mode", doc="mode", default="0644")
option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") option_14 = FilenameOption(name="name", doc="name", default="/tmp/file")
option_15 = StrOption(name="owner", doc="owner", default="root") option_15 = StrOption(name="owner", doc="owner", default="root")
option_16 = StrOption(name="source", doc="source", default="file") 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_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_8 = OptionDescription(name="files", doc="files", children=[option_9])
option_18 = BoolOption(name="activate", doc="activate", default=True) option_18 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -13,7 +13,7 @@ except:
from tiramisu import * from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) 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_6 = BoolOption(name="manage", doc="manage", default=True)
option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_6]) 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"})) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<services>
<service name='test' servicelist="test">
</service>
</services>
<variables>
<variable name="condition1">
<value>no</value>
</variable>
<variable name="condition2">
<value>no</value>
</variable>
</variables>
<constraints>
<condition name="disabled_if_in" source="condition1">
<param>no</param>
<target>condition2</target>
</condition>
<condition name="disabled_if_in" source="condition2">
<param>yes</param>
<target type="servicelist">test</target>
</condition>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1,14 @@
{
"rougail.condition1": {
"owner": "default",
"value": "no"
},
"services.test.activate": {
"owner": "default",
"value": false
},
"services.test.manage": {
"owner": "default",
"value": true
}
}

View file

@ -0,0 +1,5 @@
{
"rougail.condition1": "no",
"services.test.activate": false,
"services.test.manage": true
}

View file

@ -0,0 +1,14 @@
{
"rougail.condition1": {
"owner": "default",
"value": "no"
},
"services.test.activate": {
"owner": "default",
"value": false
},
"services.test.manage": {
"owner": "default",
"value": true
}
}

View file

@ -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])

View file

@ -24,7 +24,7 @@ option_14 = StrOption(name="source", doc="source", default="file")
option_15 = BoolOption(name="activate", doc="activate", default=True) 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_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_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_17 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) 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"})) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))

View file

@ -18,7 +18,7 @@ option_8 = SymLinkOption(name="name", opt=option_3)
option_9 = BoolOption(name="activate", doc="activate", default=True) 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_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_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_11 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) 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"})) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))

View file

@ -13,7 +13,7 @@ except:
from tiramisu import * from tiramisu import *
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) 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_6 = BoolOption(name="manage", doc="manage", default=False)
option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_6]) 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"})) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))

View file

@ -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_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_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = SymLinkOption(name="name", opt=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_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_6 = OptionDescription(name="ip", doc="ip", children=[option_7])
option_10 = BoolOption(name="activate", doc="activate", default=True) option_10 = BoolOption(name="activate", doc="activate", default=True)

View file

@ -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_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_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_8 = SymLinkOption(name="name", opt=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_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_6 = OptionDescription(name="ip", doc="ip", children=[option_7])
option_10 = BoolOption(name="activate", doc="activate", default=True) option_10 = BoolOption(name="activate", doc="activate", default=True)