fix: add tests
This commit is contained in:
parent
15c78c2c0f
commit
313e84cd28
18 changed files with 173 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.var": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.var": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.var": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
["rougail.var"]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.var": []
|
||||
}
|
||||
|
|
@ -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])
|
||||
|
|
@ -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])
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -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"
|
||||
}
|
||||
18
tests/types/result/family_triple_redefine/tiramisu.py
Normal file
18
tests/types/result/family_triple_redefine/tiramisu.py
Normal file
|
|
@ -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])
|
||||
5
tests/types/result/family_triple_redefine/variables.json
Normal file
5
tests/types/result/family_triple_redefine/variables.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -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
|
||||
...
|
||||
13
tests/types/types/family_triple_redefine/00_type.yml
Normal file
13
tests/types/types/family_triple_redefine/00_type.yml
Normal file
|
|
@ -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
|
||||
...
|
||||
13
tests/types/types/family_triple_redefine/10_redefine.yml
Normal file
13
tests/types/types/family_triple_redefine/10_redefine.yml
Normal file
|
|
@ -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
|
||||
...
|
||||
13
tests/types/types/family_triple_redefine/20_redefine.yml
Normal file
13
tests/types/types/family_triple_redefine/20_redefine.yml
Normal file
|
|
@ -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
|
||||
...
|
||||
Loading…
Reference in a new issue