diff --git a/tests/dictionaries/00_8test/dictionaries/rougail/00-base.yml b/tests/dictionaries/00_8test/dictionaries/rougail/00-base.yml index 53355b261..6a22bef08 100644 --- a/tests/dictionaries/00_8test/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/00_8test/dictionaries/rougail/00-base.yml @@ -31,3 +31,10 @@ var5: type: boolean test: - false + +var6: + description: the sixth variable + multi: true + test: + - test1 + - test2 diff --git a/tests/dictionaries/00_8test/makedict/after.json b/tests/dictionaries/00_8test/makedict/after.json index 30ac7cbe2..1384eabb7 100644 --- a/tests/dictionaries/00_8test/makedict/after.json +++ b/tests/dictionaries/00_8test/makedict/after.json @@ -18,5 +18,9 @@ "rougail.var5": { "owner": "default", "value": true + }, + "rougail.var6": { + "owner": "default", + "value": [] } } diff --git a/tests/dictionaries/00_8test/makedict/base.json b/tests/dictionaries/00_8test/makedict/base.json index 2eb550795..e07feb25b 100644 --- a/tests/dictionaries/00_8test/makedict/base.json +++ b/tests/dictionaries/00_8test/makedict/base.json @@ -3,5 +3,6 @@ "rougail.var2": "value", "rougail.var3": null, "rougail.var4": null, - "rougail.var5": true + "rougail.var5": true, + "rougail.var6": [] } diff --git a/tests/dictionaries/00_8test/makedict/before.json b/tests/dictionaries/00_8test/makedict/before.json index 30ac7cbe2..1384eabb7 100644 --- a/tests/dictionaries/00_8test/makedict/before.json +++ b/tests/dictionaries/00_8test/makedict/before.json @@ -18,5 +18,9 @@ "rougail.var5": { "owner": "default", "value": true + }, + "rougail.var6": { + "owner": "default", + "value": [] } } diff --git a/tests/dictionaries/00_8test/makedict/mandatory.json b/tests/dictionaries/00_8test/makedict/mandatory.json index 7e7f9089e..4a5e800bd 100644 --- a/tests/dictionaries/00_8test/makedict/mandatory.json +++ b/tests/dictionaries/00_8test/makedict/mandatory.json @@ -1 +1 @@ -["rougail.var1", "rougail.var3"] \ No newline at end of file +["rougail.var1", "rougail.var3", "rougail.var6"] \ No newline at end of file diff --git a/tests/dictionaries/00_8test/tiramisu/base.py b/tests/dictionaries/00_8test/tiramisu/base.py index e479d45d3..6ef4c43dc 100644 --- a/tests/dictionaries/00_8test/tiramisu/base.py +++ b/tests/dictionaries/00_8test/tiramisu/base.py @@ -15,5 +15,6 @@ option_3 = StrOption(name="var2", doc="the second variable", default="value", pr option_4 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) option_5 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')}) option_6 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)}) -optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4, option_5, option_6], properties=frozenset({"basic"})) +option_7 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) +optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4, option_5, option_6, option_7], properties=frozenset({"basic"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/00_8test/tiramisu/multi.py b/tests/dictionaries/00_8test/tiramisu/multi.py index 5f4c906d9..434df026c 100644 --- a/tests/dictionaries/00_8test/tiramisu/multi.py +++ b/tests/dictionaries/00_8test/tiramisu/multi.py @@ -15,13 +15,15 @@ option_4 = StrOption(name="var2", doc="the second variable", default="value", pr option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) option_6 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')}) option_7 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)}) -optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7], properties=frozenset({"basic"})) +option_8 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"basic"})) optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"})) -option_10 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)}) -option_11 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)}) -option_12 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) -option_13 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')}) -option_14 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)}) -optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_10, option_11, option_12, option_13, option_14], properties=frozenset({"basic"})) -optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"basic"})) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8]) +option_11 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)}) +option_12 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)}) +option_13 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) +option_14 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')}) +option_15 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)}) +option_16 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) +optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"basic"})) +optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9]) diff --git a/tests/dictionaries/00_8test/tiramisu/no_namespace.py b/tests/dictionaries/00_8test/tiramisu/no_namespace.py index 835c149d2..de30d07fe 100644 --- a/tests/dictionaries/00_8test/tiramisu/no_namespace.py +++ b/tests/dictionaries/00_8test/tiramisu/no_namespace.py @@ -11,4 +11,5 @@ option_2 = StrOption(name="var2", doc="the second variable", default="value", pr option_3 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) option_4 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')}) option_5 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)}) -option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3, option_4, option_5]) +option_6 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')}) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3, option_4, option_5, option_6]) diff --git a/tests/dictionaries/60_0family_dynamic/dictionaries/rougail/00-base.yml b/tests/dictionaries/60_0family_dynamic/dictionaries/rougail/00-base.yml index 3f9aa5da6..1a96ff090 100644 --- a/tests/dictionaries/60_0family_dynamic/dictionaries/rougail/00-base.yml +++ b/tests/dictionaries/60_0family_dynamic/dictionaries/rougail/00-base.yml @@ -1,8 +1,10 @@ --- version: '1.1' + var: # A suffix variable - val1 - val2 + "dyn{{ identifier }}": description: A dynamic family dynamic: diff --git a/tests/dictionaries/60_0family_dynamic_test/__init__.py b/tests/dictionaries/60_0family_dynamic_test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/60_0family_dynamic_test/dictionaries/rougail/00-base.yml b/tests/dictionaries/60_0family_dynamic_test/dictionaries/rougail/00-base.yml new file mode 100644 index 000000000..c7be5f7d8 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/dictionaries/rougail/00-base.yml @@ -0,0 +1,16 @@ +--- +version: '1.1' + +var: + description: A suffix variable + multi: true + test: + - val1 + - val2 + +"dyn{{ identifier }}": + description: A dynamic family + dynamic: + variable: _.var + + var: # A dynamic variable diff --git a/tests/dictionaries/60_0family_dynamic_test/makedict/after.json b/tests/dictionaries/60_0family_dynamic_test/makedict/after.json new file mode 100644 index 000000000..e72db9d1d --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/makedict/after.json @@ -0,0 +1,17 @@ +{ + "rougail.var": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.var": { + "owner": "default", + "value": null + }, + "rougail.dynval2.var": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/60_0family_dynamic_test/makedict/base.json b/tests/dictionaries/60_0family_dynamic_test/makedict/base.json new file mode 100644 index 000000000..475b83369 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/makedict/base.json @@ -0,0 +1,8 @@ +{ + "rougail.var": [ + "val1", + "val2" + ], + "rougail.dynval1.var": null, + "rougail.dynval2.var": null +} diff --git a/tests/dictionaries/60_0family_dynamic_test/makedict/before.json b/tests/dictionaries/60_0family_dynamic_test/makedict/before.json new file mode 100644 index 000000000..e72db9d1d --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/makedict/before.json @@ -0,0 +1,17 @@ +{ + "rougail.var": { + "owner": "default", + "value": [ + "val1", + "val2" + ] + }, + "rougail.dynval1.var": { + "owner": "default", + "value": null + }, + "rougail.dynval2.var": { + "owner": "default", + "value": null + } +} diff --git a/tests/dictionaries/60_0family_dynamic_test/makedict/mandatory.json b/tests/dictionaries/60_0family_dynamic_test/makedict/mandatory.json new file mode 100644 index 000000000..ab51d9ec5 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.dynval1.var", "rougail.dynval2.var"] \ No newline at end of file diff --git a/tests/dictionaries/60_0family_dynamic_test/tiramisu/base.py b/tests/dictionaries/60_0family_dynamic_test/tiramisu/base.py new file mode 100644 index 000000000..2e382f210 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/tiramisu/base.py @@ -0,0 +1,17 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from re import compile as re_compile +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +try: + groups.namespace +except: + groups.addgroup('namespace') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_2 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'}) +option_4 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'}) +optiondescription_3 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4], properties=frozenset({"basic"}), informations={'dynamic_variable': 'rougail.var'}) +optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, optiondescription_3], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1]) diff --git a/tests/dictionaries/60_0family_dynamic_test/tiramisu/multi.py b/tests/dictionaries/60_0family_dynamic_test/tiramisu/multi.py new file mode 100644 index 000000000..13c4f9592 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/tiramisu/multi.py @@ -0,0 +1,23 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from re import compile as re_compile +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +try: + groups.namespace +except: + groups.addgroup('namespace') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_3 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'}) +option_5 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'}) +optiondescription_4 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"basic"}), informations={'dynamic_variable': '1.rougail.var'}) +optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, optiondescription_4], properties=frozenset({"basic"})) +optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"})) +option_8 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'}) +option_10 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'}) +optiondescription_9 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_8)))), children=[option_10], properties=frozenset({"basic"}), informations={'dynamic_variable': '2.rougail.var'}) +optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, optiondescription_9], properties=frozenset({"basic"})) +optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6]) diff --git a/tests/dictionaries/60_0family_dynamic_test/tiramisu/no_namespace.py b/tests/dictionaries/60_0family_dynamic_test/tiramisu/no_namespace.py new file mode 100644 index 000000000..dcd83fc63 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_test/tiramisu/no_namespace.py @@ -0,0 +1,12 @@ +from tiramisu import * +from tiramisu.setting import ALLOWED_LEADER_PROPERTIES +from re import compile as re_compile +from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription +load_functions('tests/dictionaries/../eosfunc/test.py') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_1 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'}) +option_3 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'}) +optiondescription_2 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_1)))), children=[option_3], properties=frozenset({"basic"}), informations={'dynamic_variable': 'var'}) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2])