test error number
This commit is contained in:
@ -1 +0,0 @@
|
||||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.autosavevar": "oui"}
|
@ -1,15 +0,0 @@
|
||||
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 = ChoiceOption(properties=frozenset({'force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='non', values=('oui', 'non'))
|
||||
option_4 = StrOption(properties=frozenset({'basic', 'force_store_value', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))}), name='autosavevar', doc='autosave variable', multi=False, default=Calculation(func.calc_val, Params((ParamValue("oui")), kwargs={})))
|
||||
option_2 = OptionDescription(name='general', doc='général', properties=frozenset({'basic'}), children=[option_3, option_4])
|
||||
option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2])
|
||||
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])
|
@ -2,7 +2,10 @@
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="oui/non" description="No change" auto_freeze="True">
|
||||
<variable name="module_instancie" type="oui/non" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="oui/non" description="No change" auto_freeze="True" hidden="True">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
@ -10,7 +13,7 @@
|
||||
</variables>
|
||||
<constraints>
|
||||
<fill name="calc_val" target="mode_conteneur_actif">
|
||||
<param>value</param>
|
||||
<param>oui</param>
|
||||
</fill>
|
||||
</constraints>
|
||||
</rougail>
|
0
tests/dictionaries/80auto_autofreeze/__init__.py
Normal file
0
tests/dictionaries/80auto_autofreeze/__init__.py
Normal file
0
tests/dictionaries/80auto_autofreeze/errno_50
Normal file
0
tests/dictionaries/80auto_autofreeze/errno_50
Normal file
0
tests/dictionaries/80check_unknown/errno_1
Normal file
0
tests/dictionaries/80check_unknown/errno_1
Normal file
0
tests/dictionaries/80check_unknown_var/errno_2
Normal file
0
tests/dictionaries/80check_unknown_var/errno_2
Normal file
0
tests/dictionaries/80condition_itself/errno_11
Normal file
0
tests/dictionaries/80condition_itself/errno_11
Normal file
0
tests/dictionaries/80empty_param_number/errno_27
Normal file
0
tests/dictionaries/80empty_param_number/errno_27
Normal file
0
tests/dictionaries/80empty_typeeole_eole/errno_27
Normal file
0
tests/dictionaries/80empty_typeeole_eole/errno_27
Normal file
0
tests/dictionaries/80empty_typeeole_number/errno_27
Normal file
0
tests/dictionaries/80empty_typeeole_number/errno_27
Normal file
15
tests/dictionaries/80extra_auto_freeze/00-base.xml
Normal file
15
tests/dictionaries/80extra_auto_freeze/00-base.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="général">
|
||||
<variable name="module_instancie" type="oui/non" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name="activer_ejabberd" type="oui/non" description="No change" hidden="True">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
0
tests/dictionaries/80extra_auto_freeze/__init__.py
Normal file
0
tests/dictionaries/80extra_auto_freeze/__init__.py
Normal file
0
tests/dictionaries/80extra_auto_freeze/errno_49
Normal file
0
tests/dictionaries/80extra_auto_freeze/errno_49
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name='ejabberd'>
|
||||
<variable name="mode" type="string" auto_freeze="True">
|
||||
<value>pre</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
0
tests/dictionaries/80family_change/errno_47
Normal file
0
tests/dictionaries/80family_change/errno_47
Normal file
0
tests/dictionaries/80family_changeaccent/errno_47
Normal file
0
tests/dictionaries/80family_changeaccent/errno_47
Normal file
0
tests/dictionaries/80family_several/errno_44
Normal file
0
tests/dictionaries/80family_several/errno_44
Normal file
0
tests/dictionaries/80fill_error/errno_24
Normal file
0
tests/dictionaries/80fill_error/errno_24
Normal file
0
tests/dictionaries/80fill_multi/errno_24
Normal file
0
tests/dictionaries/80fill_multi/errno_24
Normal file
0
tests/dictionaries/80hidden_if_in_filelist/errno_10
Normal file
0
tests/dictionaries/80hidden_if_in_filelist/errno_10
Normal file
0
tests/dictionaries/80leadership_auto_save/errno_29
Normal file
0
tests/dictionaries/80leadership_auto_save/errno_29
Normal file
@ -2,9 +2,10 @@
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="leader" type="string" description="leader" auto_freeze="True"/>
|
||||
<variable name="follower1" type="string" description="follower1"/>
|
||||
<variable name="follower2" type="string" description="follower2"/>
|
||||
<variable name="module_instancie" type="oui/non" description="No change"/>
|
||||
<variable name="leader" type="string" description="leader" auto_freeze="True" multi="True"/>
|
||||
<variable name="follower1" type="string" description="follower1" multi="True"/>
|
||||
<variable name="follower2" type="string" description="follower2" multi="True"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
|
0
tests/dictionaries/80leadership_autofreeze/errno_30
Normal file
0
tests/dictionaries/80leadership_autofreeze/errno_30
Normal file
0
tests/dictionaries/80leadership_notexists/errno_42
Normal file
0
tests/dictionaries/80leadership_notexists/errno_42
Normal file
0
tests/dictionaries/80redefine_double_error/errno_48
Normal file
0
tests/dictionaries/80redefine_double_error/errno_48
Normal file
0
tests/dictionaries/80redefine_error/errno_45
Normal file
0
tests/dictionaries/80redefine_error/errno_45
Normal file
0
tests/dictionaries/80redefine_fillerror/errno_24
Normal file
0
tests/dictionaries/80redefine_fillerror/errno_24
Normal file
0
tests/dictionaries/80redefine_notexists/errno_46
Normal file
0
tests/dictionaries/80redefine_notexists/errno_46
Normal file
0
tests/dictionaries/80separator_multi/errno_35
Normal file
0
tests/dictionaries/80separator_multi/errno_35
Normal file
0
tests/dictionaries/80separator_multi2/errno_35
Normal file
0
tests/dictionaries/80separator_multi2/errno_35
Normal file
0
tests/dictionaries/80separator_nonexists/errno_42
Normal file
0
tests/dictionaries/80separator_nonexists/errno_42
Normal file
0
tests/dictionaries/80unknown_type/errno_36
Normal file
0
tests/dictionaries/80unknown_type/errno_36
Normal file
0
tests/dictionaries/88valid_enum_not_number/errno_13
Normal file
0
tests/dictionaries/88valid_enum_not_number/errno_13
Normal file
@ -71,13 +71,14 @@ def launch_flattener(test_dir, test_ok=False):
|
||||
eolobj.space_visitor(eosfunc)
|
||||
tiramisu_objects = eolobj.save()
|
||||
tiramisu_dir = join(test_dir, 'tiramisu')
|
||||
tiramisu_file = join(tiramisu_dir, 'base.py')
|
||||
if not isfile(tiramisu_file) or debug:
|
||||
with open(tiramisu_file, 'w') as fh:
|
||||
fh.write(tiramisu_objects)
|
||||
with open(tiramisu_file, 'r') as fh:
|
||||
tiramisu_objects_ori = fh.read()
|
||||
assert tiramisu_objects == tiramisu_objects_ori
|
||||
if isdir(tiramisu_dir):
|
||||
tiramisu_file = join(tiramisu_dir, 'base.py')
|
||||
if not isfile(tiramisu_file) or debug:
|
||||
with open(tiramisu_file, 'w') as fh:
|
||||
fh.write(tiramisu_objects)
|
||||
with open(tiramisu_file, 'r') as fh:
|
||||
tiramisu_objects_ori = fh.read()
|
||||
assert tiramisu_objects == tiramisu_objects_ori
|
||||
|
||||
|
||||
def fake_traduc(txt):
|
||||
@ -106,8 +107,15 @@ def test_dictionary(test_dir):
|
||||
def test_error_dictionary(test_dir_error):
|
||||
assert getcwd() == ORI_DIR
|
||||
test_dir = join(dico_dirs, test_dir_error)
|
||||
with raises(DictConsistencyError):
|
||||
errno = 0
|
||||
for i in listdir(test_dir):
|
||||
if i.startswith('errno_'):
|
||||
if errno:
|
||||
raise Exception('multiple errno')
|
||||
errno = int(i.split('_')[1])
|
||||
with raises(DictConsistencyError) as err:
|
||||
launch_flattener(test_dir)
|
||||
assert err.value.errno == errno, f'expected errno: {errno}, errno: {err.value.errno}, value: {err.value}'
|
||||
assert getcwd() == ORI_DIR
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user