test information in param
This commit is contained in:
parent
f9885a023c
commit
942b3f718c
7 changed files with 32 additions and 3 deletions
|
@ -482,9 +482,6 @@ class Family(Common):
|
|||
if hasattr(self.elt, 'property'):
|
||||
for child in self.elt.property:
|
||||
self.populate_properties(child)
|
||||
if not self.attrib['properties']:
|
||||
# remove empty property
|
||||
del self.attrib['properties']
|
||||
|
||||
def get_object_name(self):
|
||||
if 'suffixes' in self.attrib:
|
||||
|
|
16
tests/dictionaries/10fill_information/00-base.xml
Normal file
16
tests/dictionaries/10fill_information/00-base.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<fill name="calc_val" target="mode_conteneur_actif">
|
||||
<param type="information">test_information</param>
|
||||
</fill>
|
||||
</constraints>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
0
tests/dictionaries/10fill_information/__init__.py
Normal file
0
tests/dictionaries/10fill_information/__init__.py
Normal file
1
tests/dictionaries/10fill_information/makedict/base.json
Normal file
1
tests/dictionaries/10fill_information/makedict/base.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "value"}
|
14
tests/dictionaries/10fill_information/tiramisu/base.py
Normal file
14
tests/dictionaries/10fill_information/tiramisu/base.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from importlib.machinery import SourceFileLoader
|
||||
func = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py').load_module()
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
option_3 = StrOption(properties=frozenset({'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)), kwargs={})))
|
||||
option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3])
|
||||
option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2])
|
||||
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])
|
|
@ -43,6 +43,7 @@ async def launch_flattener(test_dir):
|
|||
for token in modulepath.split(".")[1:]:
|
||||
mod = getattr(mod, token)
|
||||
config = await Config(mod.option_0)
|
||||
await config.information.set('test_information', 'value')
|
||||
await config.property.read_only()
|
||||
await config.property.pop('mandatory')
|
||||
await config.information.set('info', 'value')
|
||||
|
|
Loading…
Reference in a new issue