Simply library usage
This commit is contained in:
15
tests/dictionaries/45extra_without_family/00-base.xml
Normal file
15
tests/dictionaries/45extra_without_family/00-base.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<services>
|
||||
<service name="test">
|
||||
<file name="/etc/file"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<variable name="my_var">
|
||||
<value>rougail</value>
|
||||
</variable>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<rougail>
|
||||
<variables>
|
||||
<variable name="my_var"/>
|
||||
</variables>
|
||||
<constraints>
|
||||
<fill name='calc_multi_condition'>
|
||||
<param>non</param>
|
||||
<target>extra.my_var</target>
|
||||
</fill>
|
||||
</constraints>
|
||||
</rougail>
|
@ -0,0 +1 @@
|
||||
{"rougail.my_var": "rougail", "extra.my_var": null, "services.test.files.file.group": "root", "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", "services.test.files.file.owner": "root", "services.test.files.file.source": "file", "services.test.files.file.templating": "creole", "services.test.files.file.activate": true}
|
@ -0,0 +1,2 @@
|
||||
rougail
|
||||
|
29
tests/dictionaries/45extra_without_family/tiramisu/base.py
Normal file
29
tests/dictionaries/45extra_without_family/tiramisu/base.py
Normal file
@ -0,0 +1,29 @@
|
||||
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="my_var", doc="my_var", default="rougail", properties=frozenset({"mandatory", "normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_4 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"}))
|
||||
option_3 = OptionDescription(name="extra", doc="extra", children=[option_4])
|
||||
option_9 = StrOption(name="group", doc="group", default="root")
|
||||
option_10 = StrOption(name="mode", doc="mode", default="0644")
|
||||
option_11 = StrOption(name="name", doc="name", default="/etc/file")
|
||||
option_12 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_13 = StrOption(name="source", doc="source", default="file")
|
||||
option_14 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="activate", doc="activate", default=True)
|
||||
option_8 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15])
|
||||
option_7 = OptionDescription(name="files", doc="files", children=[option_8])
|
||||
option_6 = OptionDescription(name="test", doc="test", children=[option_7])
|
||||
option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3, option_5])
|
2
tests/dictionaries/45extra_without_family/tmpl/file
Normal file
2
tests/dictionaries/45extra_without_family/tmpl/file
Normal file
@ -0,0 +1,2 @@
|
||||
%%my_var
|
||||
%%extra.my_var
|
Reference in New Issue
Block a user