update tests

This commit is contained in:
Emmanuel Garette 2021-03-19 10:05:50 +01:00
parent fc686e9b7f
commit 12acf2a3f4
50 changed files with 352 additions and 22 deletions

View file

@ -2,7 +2,7 @@
<rougail version="0.9">
<variables>
<family name="general">
<variable name="domain" type="domain" description="Description">
<variable name="domain" type="domainname" description="Description">
<value>my.domain.name</value>
</variable>
</family>

View file

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<variables>
<variable name="var1">
<value>no</value>
</variable>
<variable name="var2" multi='True'/>
</variables>
<constraints>
<fill name="calc_value">
<param type="variable">var1</param>
<param type="boolean" name="multi">True</param>
<target>var2</target>
</fill>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1,12 @@
{
"rougail.var1": {
"owner": "default",
"value": "no"
},
"rougail.var2": {
"owner": "default",
"value": [
"no"
]
}
}

View file

@ -0,0 +1,6 @@
{
"rougail.var1": "no",
"rougail.var2": [
"no"
]
}

View file

@ -0,0 +1,12 @@
{
"rougail.var1": {
"owner": "default",
"value": "no"
},
"rougail.var2": {
"owner": "default",
"value": [
"no"
]
}
}

View file

@ -0,0 +1,17 @@
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="var1", doc="var1", default="no", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_2)), kwargs={'multi': ParamValue(True)})), properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -0,0 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<variables>
<variable name="var1" multi='True'>
<value>no</value>
<value>yes</value>
<value>maybe</value>
</variable>
<variable name="var2" multi='True'/>
</variables>
<constraints>
<fill name="calc_value">
<param type="variable">var1</param>
<target>var2</target>
</fill>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1,18 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"no",
"yes",
"maybe"
]
},
"rougail.var2": {
"owner": "default",
"value": [
"no",
"yes",
"maybe"
]
}
}

View file

@ -0,0 +1,12 @@
{
"rougail.var1": [
"no",
"yes",
"maybe"
],
"rougail.var2": [
"no",
"yes",
"maybe"
]
}

View file

@ -0,0 +1,18 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"no",
"yes",
"maybe"
]
},
"rougail.var2": {
"owner": "default",
"value": [
"no",
"yes",
"maybe"
]
}
}

View file

@ -0,0 +1,17 @@
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="var1", doc="var1", multi=True, default=['no', 'yes', 'maybe'], default_multi="no", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="var2", doc="var2", multi=True, default=Calculation(func.calc_value, Params((ParamOption(option_2)))), properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -12,7 +12,7 @@ try:
except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption())), warnings_only=False)], properties=frozenset({"normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False))), warnings_only=False)], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -13,7 +13,7 @@ except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_4 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"}))
option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption()), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_4)}), warnings_only=False)], properties=frozenset({"normal"}))
option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption(whole=False)), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_4)}), warnings_only=False)], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -13,7 +13,7 @@ except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_5 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -12,7 +12,7 @@ try:
except:
from tiramisu import *
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -14,7 +14,7 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -14,7 +14,7 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=False), Calculation(func.valid_differ, Params((ParamSelfOption(whole=False), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -14,7 +14,7 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"}))
option_6 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(), ParamOption(option_4), ParamOption(option_5))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_6 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_4), ParamOption(option_5))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -13,7 +13,7 @@ except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"}))
option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -13,7 +13,7 @@ except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=True)], properties=frozenset({"basic", "mandatory"}))
option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(whole=False), ParamOption(option_4))), warnings_only=True)], properties=frozenset({"basic", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -15,7 +15,7 @@ option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non"
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_6 = StrOption(name="leader", doc="leader", multi=True)
option_7 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"}))
option_8 = StrOption(name="follower2", doc="follower2", multi=submulti, default=Calculation(func.calc_val, Params((ParamOption(option_7)))), properties=frozenset({"normal"}))
option_8 = StrOption(name="follower2", doc="follower2", multi=submulti, default=[Calculation(func.calc_val, Params((ParamOption(option_7))))], properties=frozenset({"normal"}))
option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"}))
option_4 = OptionDescription(name="general1", doc="general1", children=[option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4])

View file

@ -0,0 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<variables>
<family name="general">
<variable name="var" type="number" description="New variable">
<value>9</value>
</variable>
</family>
</variables>
<constraints>
<check name="valid_enum">
<param type="function">trange</param>
<param type="number">0</param>
<param type="number">10</param>
<target>var</target>
</check>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1,6 @@
{
"rougail.general.var": {
"owner": "default",
"value": 9
}
}

View file

@ -0,0 +1,3 @@
{
"rougail.general.var": 9
}

View file

@ -0,0 +1,6 @@
{
"rougail.general.var": {
"owner": "default",
"value": 9
}
}

View file

@ -0,0 +1,17 @@
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_3 = ChoiceOption(name="var", doc="New variable", values=Calculation(func.trange, Params((ParamValue(0), ParamValue(10)))), default=9, properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -15,6 +15,6 @@ from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"}))
option_7 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_5, 'val1', option_4)))), properties=frozenset({"normal"}))
option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4, option_6])

View file

@ -16,7 +16,7 @@ option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_7 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_7, todict=True, notraisepropertyerror=True), 'expected': ParamValue("non")}))}))
option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4, option_6])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", default=Calculation(func.calc_val, Params((ParamSuffix()))), properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"}))
option_7 = StrOption(name="newvar", doc="No change", properties=frozenset({"normal"}))
option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4, option_6])

View file

@ -15,6 +15,6 @@ from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="varname", doc="No change", multi=True, default=['val1', 'val2'], default_multi="val1", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="Dyn ", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -15,7 +15,7 @@ from rougail.tiramisu import ConvertDynOptionDescription
option_3 = IntOption(name="varname", doc="No change", multi=True, default=[1, 2], default_multi=1, properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="vardyn", doc="No change", default="val", properties=frozenset({"mandatory", "normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"normal"}))
option_4 = ConvertDynOptionDescription(name="dyn", doc="dyn", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_5], properties=frozenset({"normal"}))
option_7 = StrOption(name="newvar", doc="No change", default=Calculation(func.calc_val, Params((ParamDynOption(option_5, '1', option_4)))), properties=frozenset({"normal"}))
option_6 = OptionDescription(name="new", doc="new", children=[option_7], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4, option_6])

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
<family name="general2" hidden="True">
<variable name="mode_conteneur_actif2" type="string" description="No change" hidden="True">
<value>oui</value>
</variable>
<variable name="mode_conteneur_actif3" type="string" description="No change">
<value>non</value>
</variable>
</family>
</variables>
<constraints>
<condition name="disabled_if_in" source="mode_conteneur_actif">
<param>oui</param>
<target type="variable">mode_conteneur_actif3</target>
</condition>
<condition name="disabled_if_in" source="mode_conteneur_actif2">
<param>oui</param>
<target type="variable">mode_conteneur_actif3</target>
</condition>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1,10 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"rougail.general2.mode_conteneur_actif2": {
"owner": "default",
"value": "oui"
}
}

View file

@ -0,0 +1,4 @@
{
"rougail.general.mode_conteneur_actif": "non",
"rougail.general2.mode_conteneur_actif2": "oui"
}

View file

@ -0,0 +1,10 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"rougail.general2.mode_conteneur_actif2": {
"owner": "default",
"value": "oui"
}
}

View file

@ -0,0 +1,20 @@
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_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif3", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))}))
option_4 = OptionDescription(name="general2", doc="general2", children=[option_5, option_6], properties=frozenset({"hidden", "normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -2,9 +2,7 @@
<rougail version="0.9">
<variables>
<family name="général">
<variable name="module_instancie" type="string" description="No change">
<value>non</value>
</variable>
<variable name="server_deployed" type="boolean" description="No change"/>
<variable name="activer_ejabberd" type="string" description="No change" hidden="True">
<value>non</value>
</variable>

View file

@ -0,0 +1,14 @@
{
"rougail.general.server_deployed": {
"owner": "default",
"value": true
},
"rougail.general.activer_ejabberd": {
"owner": "default",
"value": "non"
},
"extra.ejabberd.mode": {
"owner": "forced",
"value": "pre"
}
}

View file

@ -0,0 +1,5 @@
{
"rougail.general.server_deployed": true,
"rougail.general.activer_ejabberd": "non",
"extra.ejabberd.mode": "pre"
}

View file

@ -0,0 +1,14 @@
{
"rougail.general.server_deployed": {
"owner": "default",
"value": true
},
"rougail.general.activer_ejabberd": {
"owner": "default",
"value": "non"
},
"extra.ejabberd.mode": {
"owner": "default",
"value": "pre"
}
}

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_3 = BoolOption(name="server_deployed", doc="No change", default=True, properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_7 = StrOption(name="mode", doc="mode", default="pre", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"basic"}))
option_5 = OptionDescription(name="extra", doc="extra", children=[option_6])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5])

View file

@ -16,6 +16,6 @@ option_3 = StrOption(name="varname", doc="No change", multi=True, default=['a'],
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_6 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"}))
option_5 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3)))), children=[option_6], properties=frozenset({"normal"}))
option_5 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_3, notraisepropertyerror=True)))), children=[option_6], properties=frozenset({"normal"}))
option_4 = OptionDescription(name="extra", doc="extra", children=[option_5])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View file

@ -18,6 +18,6 @@ option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_6 = StrOption(name="varname", doc="No change", multi=True, default=['a'], default_multi="a", properties=frozenset({"mandatory", "normal"}))
option_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"normal"}))
option_8 = StrOption(name="mode", doc="mode", properties=frozenset({"normal"}))
option_7 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6)))), children=[option_8], properties=frozenset({"normal"}))
option_7 = ConvertDynOptionDescription(name="ejabberd", doc="ejabberd", suffixes=Calculation(func.calc_value, Params((ParamOption(option_6, notraisepropertyerror=True)))), children=[option_8], properties=frozenset({"normal"}))
option_4 = OptionDescription(name="extra", doc="extra", children=[option_5, option_7])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])