diff --git a/tests/dictionaries/60_0family_dynamic_double/makedict/after.json b/tests/dictionaries/60_0family_dynamic_double/makedict/after.json new file mode 100644 index 000000000..7799ba404 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/makedict/after.json @@ -0,0 +1,6 @@ +{ + "rougail.var": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/60_0family_dynamic_double/makedict/base.json b/tests/dictionaries/60_0family_dynamic_double/makedict/base.json new file mode 100644 index 000000000..a132f4593 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/makedict/base.json @@ -0,0 +1,3 @@ +{ + "rougail.var": [] +} diff --git a/tests/dictionaries/60_0family_dynamic_double/makedict/before.json b/tests/dictionaries/60_0family_dynamic_double/makedict/before.json new file mode 100644 index 000000000..7799ba404 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/makedict/before.json @@ -0,0 +1,6 @@ +{ + "rougail.var": { + "owner": "default", + "value": [] + } +} diff --git a/tests/dictionaries/60_0family_dynamic_double/makedict/mandatory.json b/tests/dictionaries/60_0family_dynamic_double/makedict/mandatory.json new file mode 100644 index 000000000..f030b0c48 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/makedict/mandatory.json @@ -0,0 +1 @@ +["rougail.var"] \ No newline at end of file diff --git a/tests/dictionaries/60_0family_dynamic_double/makedict/read_write.json b/tests/dictionaries/60_0family_dynamic_double/makedict/read_write.json new file mode 100644 index 000000000..a132f4593 --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/makedict/read_write.json @@ -0,0 +1,3 @@ +{ + "rougail.var": [] +} diff --git a/tests/dictionaries/60_0family_dynamic_double/tiramisu/base.py b/tests/dictionaries/60_0family_dynamic_double/tiramisu/base.py new file mode 100644 index 000000000..f9772c99b --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/tiramisu/base.py @@ -0,0 +1,19 @@ +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('../rougail-tests/funcs/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, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], 'type': 'string'}) +option_4 = StrOption(name="var", doc="A dynamic variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], 'type': 'string'}) +option_6 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], 'type': 'string'}) +optiondescription_5 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_4)))), children=[option_6], properties=frozenset({"basic"}), informations={'dynamic_variable': 'rougail.dyn{{ identifier }}.var', 'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml']}) +optiondescription_3 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4, optiondescription_5], properties=frozenset({"basic"}), informations={'dynamic_variable': 'rougail.var', 'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml']}) +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_double/tiramisu/no_namespace.py b/tests/dictionaries/60_0family_dynamic_double/tiramisu/no_namespace.py new file mode 100644 index 000000000..f60289fbc --- /dev/null +++ b/tests/dictionaries/60_0family_dynamic_double/tiramisu/no_namespace.py @@ -0,0 +1,18 @@ +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('../rougail-tests/funcs/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_1 = StrOption(name="var", doc="A suffix variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], 'type': 'string'}) +option_3 = StrOption(name="var", doc="A dynamic variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], 'type': 'string'}) +option_5 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml'], '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': 'dyn{{ identifier }}.var', 'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml']}) +optiondescription_2 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_1)))), children=[option_3, optiondescription_4], properties=frozenset({"basic"}), informations={'dynamic_variable': 'var', 'ymlfiles': ['../rougail-tests/structures/60_0family_dynamic_double/rougail/00-base.yml']}) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2]) diff --git a/tests/test_types.py b/tests/test_types.py index 15170e7cc..cec836459 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -107,6 +107,14 @@ def test_type_family_redefine_double_namespace(): type_variable("family_double_redefine", namespace=True) +def test_type_family_tiple_redefine2(): + type_variable("family_triple_redefine") + + +def test_type_family_redefine_triple_namespace(): + type_variable("family_triple_redefine", namespace=True) + + def test_type_family_redefine_2(): with raises(DictConsistencyError) as err: type_variable("family_redefine_family_types") diff --git a/tests/types/result/family_triple_redefine/namespace_tiramisu.py b/tests/types/result/family_triple_redefine/namespace_tiramisu.py new file mode 100644 index 000000000..ca70ce5dd --- /dev/null +++ b/tests/types/result/family_triple_redefine/namespace_tiramisu.py @@ -0,0 +1,19 @@ +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 +try: + groups.namespace +except: + groups.addgroup('namespace') +ALLOWED_LEADER_PROPERTIES.add("basic") +ALLOWED_LEADER_PROPERTIES.add("standard") +ALLOWED_LEADER_PROPERTIES.add("advanced") +option_4 = StrOption(name="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/types/family_triple_redefine/20_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/types/family_triple_redefine/20_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +option_6 = StrOption(name="my_type", doc="My type ori", default="a value ori", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_5 = OptionDescription(name="my_family_2", doc="My family type", children=[option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +option_8 = StrOption(name="my_type", doc="My type ori 1", default="a value ori 1", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_7 = OptionDescription(name="my_family_3", doc="My family type ori 1", children=[option_8], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_5, optiondescription_7], properties=frozenset({"standard"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/types/result/family_triple_redefine/namespace_variables.json b/tests/types/result/family_triple_redefine/namespace_variables.json new file mode 100644 index 000000000..fdb0d1a8b --- /dev/null +++ b/tests/types/result/family_triple_redefine/namespace_variables.json @@ -0,0 +1,5 @@ +{ + "ns2.my_family_1.my_type": "a value", + "ns2.my_family_2.my_type": "a value ori", + "ns2.my_family_3.my_type": "a value ori 1" +} \ No newline at end of file diff --git a/tests/types/result/family_triple_redefine/namespace_variables_rw.json b/tests/types/result/family_triple_redefine/namespace_variables_rw.json new file mode 100644 index 000000000..fdb0d1a8b --- /dev/null +++ b/tests/types/result/family_triple_redefine/namespace_variables_rw.json @@ -0,0 +1,5 @@ +{ + "ns2.my_family_1.my_type": "a value", + "ns2.my_family_2.my_type": "a value ori", + "ns2.my_family_3.my_type": "a value ori 1" +} \ No newline at end of file diff --git a/tests/types/result/family_triple_redefine/tiramisu.py b/tests/types/result/family_triple_redefine/tiramisu.py new file mode 100644 index 000000000..0be0b55c0 --- /dev/null +++ b/tests/types/result/family_triple_redefine/tiramisu.py @@ -0,0 +1,18 @@ +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 +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="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/types/family_triple_redefine/20_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_1 = OptionDescription(name="my_family_1", doc="My family type", children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/types/family_triple_redefine/20_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +option_4 = StrOption(name="my_type", doc="My type ori", default="a value ori", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_3 = OptionDescription(name="my_family_2", doc="My family type", children=[option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/types/family_triple_redefine/10_redefine.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +option_6 = StrOption(name="my_type", doc="My type ori 1", default="a value ori 1", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +optiondescription_5 = OptionDescription(name="my_family_3", doc="My family type ori 1", children=[option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_triple_redefine/00_type.yml', 'tests/types/structures/family_triple_redefine/00_structure.yml']}) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_3, optiondescription_5]) diff --git a/tests/types/result/family_triple_redefine/variables.json b/tests/types/result/family_triple_redefine/variables.json new file mode 100644 index 000000000..cd870d5ba --- /dev/null +++ b/tests/types/result/family_triple_redefine/variables.json @@ -0,0 +1,5 @@ +{ + "my_family_1.my_type": "a value", + "my_family_2.my_type": "a value ori", + "my_family_3.my_type": "a value ori 1" +} diff --git a/tests/types/result/family_triple_redefine/variables_rw.json b/tests/types/result/family_triple_redefine/variables_rw.json new file mode 100644 index 000000000..63d9bdb96 --- /dev/null +++ b/tests/types/result/family_triple_redefine/variables_rw.json @@ -0,0 +1,5 @@ +{ + "my_family_1.my_type": "a value", + "my_family_2.my_type": "a value ori", + "my_family_3.my_type": "a value ori 1" +} \ No newline at end of file diff --git a/tests/types/structures/family_triple_redefine/00_structure.yml b/tests/types/structures/family_triple_redefine/00_structure.yml new file mode 100644 index 000000000..b00f01dde --- /dev/null +++ b/tests/types/structures/family_triple_redefine/00_structure.yml @@ -0,0 +1,13 @@ +%YAML 1.2 +--- +version: 1.1 + +my_family_1: + type: my_family_type + +my_family_2: + type: my_family_type_ori + +my_family_3: + type: my_family_type_ori_1 +... diff --git a/tests/types/types/family_triple_redefine/00_type.yml b/tests/types/types/family_triple_redefine/00_type.yml new file mode 100644 index 000000000..cfec61d26 --- /dev/null +++ b/tests/types/types/family_triple_redefine/00_type.yml @@ -0,0 +1,13 @@ +%YAML 1.2 +--- +version: 1.1 + +my_family_type_ori_1: + description: My family type ori 1 + + my_type: + description: My type ori 1 + default: a value ori 1 + tags: + - one_tag +... diff --git a/tests/types/types/family_triple_redefine/10_redefine.yml b/tests/types/types/family_triple_redefine/10_redefine.yml new file mode 100644 index 000000000..48750bed5 --- /dev/null +++ b/tests/types/types/family_triple_redefine/10_redefine.yml @@ -0,0 +1,13 @@ +%YAML 1.2 +--- +version: 1.1 + +my_family_type_ori: + description: My family type + type: my_family_type_ori_1 + + my_type: + redefine: true + description: My type ori + default: a value ori +... diff --git a/tests/types/types/family_triple_redefine/20_redefine.yml b/tests/types/types/family_triple_redefine/20_redefine.yml new file mode 100644 index 000000000..15a065666 --- /dev/null +++ b/tests/types/types/family_triple_redefine/20_redefine.yml @@ -0,0 +1,13 @@ +%YAML 1.2 +--- +version: 1.1 + +my_family_type: + description: My family type + type: my_family_type_ori + + my_type: + redefine: true + description: My type + default: a value +...