Compare commits

...

130 Commits

Author SHA1 Message Date
ce0a46232d Merge remote-tracking branch 'official/master' into develop 2021-05-18 18:54:36 +02:00
64017d5cd4 import/export informations 2021-05-18 18:53:14 +02:00
b0462a1e80 . is no more unvalable 2021-05-18 18:52:42 +02:00
8b4af12217 Merge remote-tracking branch 'official/master' into develop 2021-05-16 06:52:38 +02:00
a5b6352188 calc_value: join with multi 2021-05-16 06:51:33 +02:00
75a073455e Merge remote-tracking branch 'official/master' into develop 2021-04-12 15:05:32 +02:00
87093da974 add test about deepcopy with multi parents 2021-04-03 20:38:08 +02:00
f7721a9775 manage force_store_value with dynoption 2021-04-03 20:24:27 +02:00
33f9cbdc64 allow caching with the demoting_error_warning property 2021-03-29 10:35:56 +02:00
6084487d08 add test to dyn optiondescription 2021-03-29 10:35:56 +02:00
9576809543 dict with leader_to_list parameter 2021-03-29 10:35:56 +02:00
af2d3eb3ce calculation with submulti 2021-03-29 10:35:56 +02:00
b76db42204 better error when value not in a choice 2021-03-29 10:35:56 +02:00
5858bcc00b Calculation to non-leader option with leader parameter is now possible 2021-03-29 10:35:56 +02:00
200562d23c manage callback with unrestraint 2021-03-29 10:35:56 +02:00
2f173af70f Add ParamSelfInformation 2021-03-29 10:35:56 +02:00
9a4faf391e 2020/2021 2021-03-29 10:35:56 +02:00
e2d5a1c8aa filename must be a full path 2021-03-29 10:35:56 +02:00
0bb066a8b8 exected could be a list 2021-03-29 10:35:56 +02:00
d3d4de7ae3 wrong leadership name in dict() 2021-03-29 10:35:56 +02:00
f0be02b80f better error message 2021-03-29 10:35:55 +02:00
b9107867c9 do not remove notempty and notunique properties 2021-03-29 10:35:55 +02:00
3b1dccd844 allow caching with the demoting_error_warning property 2021-03-21 14:51:12 +01:00
12174045a2 add test to dyn optiondescription 2021-03-18 09:00:28 +01:00
8972e796db dict with leader_to_list parameter 2021-03-18 09:00:04 +01:00
29282d8ea3 calculation with submulti 2021-03-18 08:57:22 +01:00
668ed3ad37 better error when value not in a choice 2021-03-18 08:54:59 +01:00
da946baba6 Calculation to non-leader option with leader parameter is now possible 2021-03-18 08:52:22 +01:00
0167f4e2d0 manage callback with unrestraint 2021-03-08 06:39:40 +01:00
acc86bc49f Add ParamSelfInformation 2021-03-06 19:23:35 +01:00
7ebad5724e 2020/2021 2021-02-24 20:30:04 +01:00
385160cabd filename must be a full path 2021-02-17 09:50:36 +01:00
99a422dad7 exected could be a list 2021-02-06 15:18:28 +01:00
bfed49a11f wrong leadership name in dict() 2021-01-11 22:40:25 +01:00
c9e166f1d4 better error message 2020-11-21 19:26:50 +01:00
da87f40f12 do not remove notempty and notunique properties 2020-11-03 22:34:57 +01:00
3e0e7244ef Merge remote-tracking branch 'official/master' into develop 2020-10-14 22:31:54 +02:00
e1fef11465 refactor 2020-10-05 21:16:41 +02:00
a269cbcc93 copy/deepcopy should duplicate informations 2020-10-05 20:27:17 +02:00
cd50225bad Merge remote-tracking branch 'official/master' into develop 2020-10-03 16:18:21 +02:00
6910371779 Add ParamInformation and callback can be a coroutine 2020-10-03 14:29:15 +02:00
afeedc1db6 config_bag and name not already exists 2020-08-15 00:23:48 +02:00
ba23a144ce Merge remote-tracking branch 'official/master' into develop 2020-08-12 11:59:50 +02:00
50d42624cc better support of PACKAGE_DST environment variable 2020-08-12 11:55:55 +02:00
659243ba8f better support for warnings_only 2020-08-04 16:49:21 +02:00
dc8010f0af calc_value with join parameter now work if an option is empty 2020-08-04 16:43:40 +02:00
96c76286db get dependencies in API 2020-08-04 16:35:40 +02:00
5c1d4afd56 remove unconsistent test 2020-08-04 16:35:10 +02:00
c4572ec409 remove codeset to i18n 2020-08-04 16:34:43 +02:00
2f125cfc8c better error for IP like 192.168.001.1 => 192.168.1.1 2020-08-04 16:33:52 +02:00
4b3ac5f350 New release candidate 3.0 rc16 2020-07-29 16:25:01 +02:00
2d7729612b can load old session 2020-04-21 19:19:04 +02:00
86a48ce9f1 support callback with submulti 2020-04-21 17:13:25 +02:00
f437bb78f3 add a test with default_multi for a submulti follower 2020-04-21 09:16:29 +02:00
f7bd6e3a47 add support in calculation when option is in a dynoptiondescription 2020-04-11 13:13:35 +02:00
d71018a88e release 3.0rc16 2020-04-01 11:49:18 +02:00
2d2e8a63fb add new argument in config.new() 2020-03-16 15:38:41 +01:00
6929d2740d do not raise error if setting is not changed 2020-03-14 22:31:42 +01:00
f1651848d2 can create a config with a mix_config 2020-03-04 15:39:47 +01:00
ad6ed0a648 storage in groupconfig 2020-02-18 22:10:33 +01:00
6b33bddbac validate value before validate unique value 2020-02-18 22:09:53 +01:00
91c44b38bc ip_in_network without all information 2020-02-18 22:08:52 +01:00
3bef45c9db New Postgres storage 2020-01-30 16:10:54 +01:00
746fa0134f add tiramisu/asyncinit.py file 2020-01-17 14:15:57 +01:00
1861dc59d4 add leader_to_list to dict message 2019-12-28 12:30:32 +01:00
52ddd76b1a corrections in dict and todict 2019-12-25 20:44:56 +01:00
503d4b2cca async version of tiramisu 2019-12-24 15:25:12 +01:00
76e7fd93b2 can convert suffix to build path for dynoptiondescription 2019-12-21 18:29:21 +01:00
0cb69f7a85 empty follower without empty property is valid 2019-12-19 17:18:09 +01:00
fb93c0cf6f updates tests 2019-12-08 09:09:48 +01:00
4e04082cec error should be returned in todict 2019-12-08 08:15:47 +01:00
d958b9dfad do not init storage before first used 2019-12-08 08:15:14 +01:00
d9c0b18404 'new' config allow storage 2019-12-08 08:14:36 +01:00
9cc4518087 copy value before store it 2019-12-02 10:42:17 +01:00
cdcb155acc support of todict 2019-12-02 10:41:43 +01:00
27838e67a3 support of sqlite3 2019-12-02 10:41:16 +01:00
8345a4651d can get uncalculated property 2019-12-02 10:40:17 +01:00
b6c11c08db add MacOption, remove UnicodeOption 2019-12-02 10:39:10 +01:00
358a49c0e2 can get uncalculated property + can add storage when init mixconfig 2019-12-02 10:37:21 +01:00
212fd5f16d easy way to add a group 2019-11-29 12:07:43 +01:00
323d1b83d6 hack to make a dict without all none implemented feature 2019-11-29 12:07:18 +01:00
709c0bf228 force_store_value for follower 2019-11-20 08:29:45 +01:00
1bcad4d7ed corrections in has_index 2019-11-20 08:28:26 +01:00
13c0c0e256 better error message 2019-11-20 08:27:33 +01:00
ce297ed804 better unique support 2019-11-20 08:26:41 +01:00
973b81d339 add GroupnameOption 2019-11-20 08:25:16 +01:00
9d5bae9305 better follower properties 2019-11-20 08:24:13 +01:00
8fa91abefb calc_value: inverse_condition => reverse_condition 2019-11-20 08:22:12 +01:00
d3e99cc9a5 notunique and notempty support 2019-11-19 18:52:20 +01:00
6b77b0c5ad DomainnameOption add network support 2019-11-19 18:48:13 +01:00
c5d8e0055b force_store_value for follower 2019-11-19 18:46:05 +01:00
7325f6e12f add index to properties/permissives 2019-11-19 18:39:44 +01:00
15669372db add GroupnameOption 2019-11-19 18:31:48 +01:00
74e604478e _validation, _second_level_validation => validation, second_level_validation 2019-11-19 08:26:42 +01:00
5c3a133928 consistency is now simple validation 2019-10-27 16:53:25 +01:00
e62268c46a Merge branch 'master' into develop 2019-10-20 08:26:06 +02:00
c75425c03a Merge branch 'master' into develop 2019-10-20 08:24:48 +02:00
a7e4399ae5 get information with default attribute when information is set to an option 2019-10-16 07:42:18 +02:00
ba5cc57166 get_type not exists for optiondescription, change it to impl_get_group_type 2019-10-16 07:34:03 +02:00
280d2ebd0a better error message if option that does not exists is in root optiondescription 2019-10-16 07:31:52 +02:00
42291aec51 DynOptionDescription accept only suffixes attributes with Calculation, no more callback/callback_params 2019-10-15 17:45:21 +02:00
fd50913466 add Calculation to values 2019-09-28 16:32:48 +02:00
f976c31233 Changelog 2019-09-16 07:56:34 +02:00
06ad839468 add parents method to MetaConfig 2019-09-02 14:11:36 +02:00
bb2ecc94d9 add Calculation to properties 2019-09-01 09:41:53 +02:00
7c641961d3 better validation with parent + deepconfig 2019-08-28 15:55:10 +02:00
4321bde399 prefix metaconfig_prefix with current name 2019-08-26 17:04:46 +02:00
c15dac8093 unrestraint in subconfig 2019-08-24 08:14:54 +02:00
82a91db16e prefix metaconfig_prefix with current name 2019-08-21 16:24:50 +02:00
5ff47ac5c9 rc 11 2019-08-19 14:13:56 +02:00
a9ca9fdb6a add multi parents tests 2019-08-07 08:40:23 +02:00
b6ec77aa23 better way to manage follower in MetaConfig 2019-08-07 08:38:32 +02:00
2d7d237e19 Config could have multiple parents 2019-08-05 22:31:56 +02:00
113b7a3410 todict works with Metaconfig 2019-08-03 21:03:23 +02:00
1691e38db5 separate Cache from values and settings 2019-08-01 18:22:18 +02:00
c5ce9be699 doc + description + can updates with dict 2019-07-29 22:13:04 +02:00
613ae47573 update tests ans version number 2019-07-26 10:13:45 +02:00
fd18af62ca update Changelog and translation 2019-07-26 09:45:19 +02:00
34d71901d0 to_dict improvment and add display_name parameter to change impl_get_display_name function 2019-07-26 08:55:20 +02:00
35ef218c9c better message error 2019-07-26 08:52:01 +02:00
a33c7ed41e follower option with consistency 2019-07-16 08:03:33 +02:00
73d45f54cf follower option with consistency 2019-07-14 10:35:46 +02:00
69384a5e69 update translations 2019-07-06 11:39:06 +02:00
e73f3d1e47 we have to access to option without restriction 2019-07-06 08:36:13 +02:00
d3eef77c03 works with test/auto tests 2019-07-06 07:18:32 +02:00
fb1286e50e better hidden/display support 2019-07-04 20:43:47 +02:00
83f05197fb update todict support and tests 2019-06-21 23:04:04 +02:00
55da00f131 3.0 rc 8 2019-06-21 09:14:09 +02:00
516a5a7219 copy default properties when copy config or create a config in a metaconfig 2019-06-20 15:24:21 +02:00
620e8bbf2e optimize 2019-06-12 08:45:56 +02:00
201 changed files with 23341 additions and 18298 deletions

View File

@ -1,3 +1,33 @@
Mon Apr 1 11:47:30 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc16
* tiramisu is now async
* add postgresql storage
Mon Sep 2 14:10:40 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc15
* add parents method to MetaConfig
Wed Aug 28 15:50:30 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc14
* correction in metaconfig_prefix
* correction in validation with parent
Mon Aug 21 14:24:42 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc12
* prefix metaconfig_prefix with current name
Mon Aug 19 08:02:27 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc11
* Config could have multiple parents
* todict works with Metaconfig
* separate Cache from values and settings
Fri Jul 26 09:43:03 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc9 and rc10
* better todict support (especially for leadership
* can add display_name method to Config init to change the name a
option in errors
Mon Jun 5 14:49:27 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc7
* retrieve metaconfig/mixconfig/config by name in a metaconfig/mixconfig

View File

@ -1,17 +0,0 @@
[build-system]
requires = ["flit"]
build-backend = "flit.buildapi"
[tool.flit.metadata]
module = "tiramisu"
author = "Emmanuel Garette"
author-email = "gnunux@gnunux.info"
home-page = "https://framagit.org/tiramisu/tiramisu"
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python :: 3",
"Natural Language :: English",
"Natural Language :: French",
"Operating System :: OS Independent",
]
requires-python = ">=3.5"

View File

@ -1,13 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from os.path import dirname, abspath, join, normpath, isdir
from os import listdir
from setuptools import setup
import os
from tiramisu import __version__
PACKAGE_NAME = os.environ.get('PACKAGE_DST', 'tiramisu')
ORI_PACKAGE_NAME = 'tiramisu'
PACKAGE_NAME = os.environ.get('PACKAGE_DST', ORI_PACKAGE_NAME)
if PACKAGE_NAME != ORI_PACKAGE_NAME:
package_dir = {PACKAGE_NAME: ORI_PACKAGE_NAME}
else:
package_dir = None
setup(
version=__version__,
@ -17,6 +21,7 @@ setup(
description='an options controller tool',
url='https://framagit.org/tiramisu/tiramisu',
license='GNU Library or Lesser General Public License (LGPL)',
provides=['tiramisu_api'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
@ -41,5 +46,6 @@ producing flexible and fast options access.
This version requires Python 3.5 or later.
""",
include_package_data=True,
packages=find_packages(include=['tiramisu'])
package_dir=package_dir,
packages=[PACKAGE_NAME],
)

View File

@ -10,7 +10,7 @@ from .autopath import do_autopath
do_autopath()
from tiramisu import Config, MetaConfig, \
StrOption, SymLinkOption, OptionDescription, Leadership, DynOptionDescription, \
submulti, undefined, owners, Params, ParamOption
submulti, undefined, owners, Params, ParamOption, Calculation
from tiramisu.error import PropertiesOptionError, APIError, ConfigError, LeadershipError
ICON = u'\u2937'
@ -191,8 +191,9 @@ def _getproperties(multi, isfollower, kwargs):
# define properties
properties = copy(PROPERTIES_LIST)
if multi and not isfollower:
default_props = ['empty']
default_props = ['empty', 'unique']
properties.append('empty')
properties.append('unique')
else:
default_props = []
extra_properties = kwargs.get('extra_properties')
@ -248,8 +249,9 @@ def _property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
# define properties
properties = copy(PROPERTIES_LIST)
if multi and not isfollower:
default_props = ['empty']
default_props = ['empty', 'unique']
properties.append('empty')
properties.append('unique')
else:
default_props = []
extra_properties = kwargs.get('extra_properties')
@ -662,8 +664,11 @@ def autocheck_append_value(cfg, mcfg, pathread, pathwrite, confread, confwrite,
with warnings.catch_warnings(record=True) as w:
if not kwargs.get('propertyerror', False):
leader_value = cfg_.forcepermissive.option(pathread).value.get()
v3 = cfg_.forcepermissive.option(pathread).value.get()
len_value = len(leader_value)
leader_value.append(undefined)
print('debut', leader_value, cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0])
print(id(leader_value), id(cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0]))
assert len(cfg_.forcepermissive.option(pathread).value.get()) == len_value
with warnings.catch_warnings(record=True) as w:
cfg2_.forcepermissive.option(pathread).value.set(leader_value)
@ -683,7 +688,12 @@ def autocheck_append_value(cfg, mcfg, pathread, pathwrite, confread, confwrite,
value = 'value'
else:
value = ['value']
print('==>>>')
print(leader_value, cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0])
print(id(leader_value), id(cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0]))
leader_value.append(value)
print(leader_value, cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0])
print(id(leader_value), id(cfg_._config_bag.context._impl_values_cache._cache['odleader.first'][None][0]))
assert len(cfg_.forcepermissive.option(pathread).value.get()) == len(new_leader_value)
cfg2_.forcepermissive.option(pathread).value.set(leader_value)
assert cfg_.forcepermissive.option(pathread).value.get()[-1] == value
@ -949,8 +959,6 @@ def autocheck_default_owner_with_value_permissive(cfg, mcfg, pathread, pathwrite
else:
assert cfg_.forcepermissive.option(pathread, 0).owner.isdefault() is True
assert cfg_.forcepermissive.option(pathread, 1).owner.isdefault() is False
#FIXME else:
# raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.isdefault()")
do(confwrite)
if confwrite != confread:
do(confread)
@ -1194,7 +1202,7 @@ def autocheck_find(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs
do(confwrite)
def check_all(cfg, paths_, path, meta, multi, default, default_multi, require, consistency, callback, symlink, weakrefs, **kwargs):
def check_all(cfg, paths_, path, meta, multi, default, default_multi, require, callback, symlink, weakrefs, **kwargs):
def _build_make_dict():
dico = {}
dico_value = {}
@ -1286,31 +1294,6 @@ def check_all(cfg, paths_, path, meta, multi, default, default_multi, require, c
if symlink:
dico['extraoptrequirelink'] = 'value'
dico_value['extraoptrequirelink'] = 'value'
if consistency and has_value:
cpath = list(dico.keys())[0]
if "." in cpath:
cpath = cpath.rsplit('.', 1)[0] + '.'
else:
cpath = ''
if multi:
value = []
else:
value = None
if is_dyn:
dico[cpath + 'extraoptconsistencyval1'] = value
dico_value[cpath + 'extraoptconsistencyval1'] = value
if is_leader:
spath = cpath.split('.')
spath[-2] = spath[-2][:-1] + '2'
spath[-3] = spath[-3][:-1] + '2'
npath = '.'.join(spath) + 'extraoptconsistencyval2'
else:
npath = cpath[:-2] + '2.' + 'extraoptconsistencyval2'
dico[npath] = value
dico_value[npath] = value
else:
dico[cpath + 'extraoptconsistency'] = value
dico_value[cpath + 'extraoptconsistency'] = value
if is_leader:
for cpath in list(paths_.keys())[len(dyns):]:
if cpath.endswith('.first') or cpath.endswith('.firstval1') or cpath.endswith('.firstval2'):
@ -1374,8 +1357,6 @@ def check_all(cfg, paths_, path, meta, multi, default, default_multi, require, c
text += u' with default multi'
if require:
text += u' with requirement'
if consistency:
text += u' with consistency'
text += u', kwargs: {}'.format(kwargs)
print(text)
if not require:
@ -1530,7 +1511,7 @@ def check_deref(weakrefs):
assert wrf() is None
def make_conf(options, multi, default, default_multi, require, consistency, callback, symlink):
def make_conf(options, multi, default, default_multi, require, callback, symlink):
weakrefs = []
dyn = []
goptions = []
@ -1593,7 +1574,8 @@ def make_conf(options, multi, default, default_multi, require, consistency, call
if callback:
largs = [path + 'call', "{}'s callback option".format(path)]
objcall = tiramisu_option(*largs, **call_kwargs)
kwargs['callback_params'] = Params(ParamOption(objcall))
kwargs['default'] = Calculation(kwargs['callback'], Params(ParamOption(objcall)))
del kwargs['callback']
else:
objcall = None
if symlink and not path.endswith('extraoptconsistency'):
@ -1603,16 +1585,8 @@ def make_conf(options, multi, default, default_multi, require, consistency, call
tiramisu_option = SymLinkOption
else:
sobj = None
print(args, kwargs)
obj = tiramisu_option(*args, **kwargs)
if not 'extraopt' in path and consistency:
if require:
if symlink:
gopt = goptions[2]
else:
gopt = goptions[1]
else:
gopt = goptions[0]
obj.impl_add_consistency('not_equal', gopt, warnings_only=True, transitive=False)
return obj, objcall, sobj
def make_optiondescriptions(path, collected):
@ -1632,7 +1606,7 @@ def make_conf(options, multi, default, default_multi, require, consistency, call
if symlink:
return
optiondescription = DynOptionDescription
kwargs['callback'] = return_list
kwargs['suffixes'] = Calculation(return_list)
dyn.append(path)
options = []
if 'options' in collected:
@ -1651,17 +1625,10 @@ def make_conf(options, multi, default, default_multi, require, consistency, call
return obj
collect_options = {}
if require or consistency:
if require:
noptions = OrderedDict()
if require:
noptions['extraoptrequire'] = {}
if consistency:
subpath = list(options.keys())[0]
if '.' in subpath:
subpath = subpath.rsplit('.', 1)[0] + '.'
else:
subpath = ''
noptions[subpath + 'extraoptconsistency'] = {}
noptions.update(options)
else:
noptions = options
@ -1812,53 +1779,48 @@ def test_options(paths):
lpaths = list(paths.keys())
for meta in (False, True):
for callback in (False, True):
for consistency in (False, True):
for require in (False, True):
for default_multi in (False, True):
for symlink in (False, True):
if callback and default_multi:
continue
for default in (False, True):
for multi in (False, True, submulti):
pass
# for meta in (True,):
# for callback in (False,):
# for consistency in (True,):
# for require in (True,):
# for default_multi in (True,):
# for symlink in (False,):
# if callback and default_multi:
# continue
# for default in (True,):
# for multi in (submulti,):
if multi is submulti and default:
continue
if multi is submulti and consistency:
continue
if multi is False and default_multi:
continue
cfg, weakrefs, dyn = make_conf(paths, multi, default, default_multi, require, consistency, callback, symlink)
if cfg is None:
continue
if dyn:
cnt = 0
idx = 0
for index, lpath in enumerate(lpaths):
if paths[lpath]:
cnt += 1
else:
check_all(cfg, paths, lpaths[index], meta, multi, default,
default_multi, require, consistency, callback, symlink,
weakrefs, **get_kwargs(lpaths[idx]))
idx += 1
if idx == cnt:
idx = 0
else:
for lpath in lpaths:
check_all(cfg, paths, lpath, meta, multi, default,
default_multi, require, consistency, callback, symlink,
weakrefs, **get_kwargs(lpath))
del cfg
check_deref(weakrefs)
# for meta in (False, True):
# for callback in (False, True):
# for require in (False, True):
# for default_multi in (False, True):
# for symlink in (False, True):
# if callback and default_multi:
# continue
# for default in (False, True):
# for multi in (False, True, submulti):
for meta in (False,):
for callback in (False,):
for require in (False,):
for default_multi in (False,):
for symlink in (False,):
if callback and default_multi:
continue
for default in (False,):
for multi in (True,):
if multi is submulti and default:
continue
if multi is False and default_multi:
continue
cfg, weakrefs, dyn = make_conf(paths, multi, default, default_multi, require, callback, symlink)
if cfg is None:
continue
if dyn:
cnt = 0
idx = 0
for index, lpath in enumerate(lpaths):
if paths[lpath]:
cnt += 1
else:
check_all(cfg, paths, lpaths[index], meta, multi, default,
default_multi, require, callback, symlink,
weakrefs, **get_kwargs(lpaths[idx]))
idx += 1
if idx == cnt:
idx = 0
else:
for lpath in lpaths:
check_all(cfg, paths, lpath, meta, multi, default,
default_multi, require, callback, symlink,
weakrefs, **get_kwargs(lpath))
del cfg
check_deref(weakrefs)

85
tests/config.py Normal file
View File

@ -0,0 +1,85 @@
# from json import dumps, loads
import asyncio
from os import environ
try:
from tiramisu_api import Config
class TestConfig(Config):
def __init__(self,
config):
self.test_option = config.option
json = self.test_option.dict()
# assert json == loads(dumps(json))
super().__init__(json)
def send_data(self,
updates):
return self.updates_data(self.test_option.updates(updates))
PARAMS = ['tiramisu', 'tiramisu-api']
except:
PARAMS = ['tiramisu']
import pytest
async def get_config(config, type, error=False):
if type == 'tiramisu':
return config
if error:
await config.property.add('demoting_error_warning')
return TestConfig(config)
def value_list(values):
if values[0] == '':
del values[0]
return tuple(values)
async def global_owner(config, config_type):
return await config.owner.get()
@pytest.fixture(params=PARAMS)
def config_type(request):
return request.param
LOOP = None
@pytest.fixture(scope='session')
def event_loop(request):
"""Create an instance of the default event loop for each test case."""
global LOOP
if LOOP is None:
LOOP = asyncio.get_event_loop_policy().new_event_loop()
return LOOP
async def _delete_sessions(meta):
if await meta.config.type() != 'config':
for conf in await meta.config.list():
await _delete_sessions(conf)
await meta.session.reset()
async def delete_sessions(confs):
if not isinstance(confs, list):
confs = [confs]
for conf in confs:
await _delete_sessions(conf)
if environ.get('TIRAMISU_STORAGE') == 'postgres':
async with confs[0]._config_bag.context.getconnection() as connection:
assert await connection.fetchrow('SELECT * FROM session') is None
assert await connection.fetchrow('SELECT * FROM value') is None
assert await connection.fetchrow('SELECT * FROM information') is None
assert await connection.fetchrow('SELECT * FROM property') is None
assert await connection.fetchrow('SELECT * FROM permissive') is None
elif environ.get('TIRAMISU_STORAGE') == 'sqlite3':
async with confs[0]._config_bag.context.getconnection() as connection:
assert await connection.select('SELECT * FROM session') is None
assert await connection.select('SELECT * FROM value') is None
assert await connection.select('SELECT * FROM information') is None
assert await connection.select('SELECT * FROM property') is None
assert await connection.select('SELECT * FROM permissive') is None
else:
from tiramisu import list_sessions
assert not await list_sessions()

View File

@ -12,7 +12,26 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.boolean": {
"clearable": true
},
"null": [
{
"title": "Configurer",

View File

@ -16,7 +16,26 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.boolean": {
"clearable": true
},
"null": [
{
"title": "Configurer",

View File

@ -17,8 +17,25 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -21,8 +21,25 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -54,20 +54,43 @@
},
"model": {
"options.choice1.choice1": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice1.choice1": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice2": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice3": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice4": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -54,26 +54,48 @@
},
"model": {
"options.choice1.choice1": {
"required": true
"required": true,
"properties": [
"unique"
]
},
"options.choice1.choice3": {
"null": {
"display": false,
"hidden": true
"display": false
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice1.choice1": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice2": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice3": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice4": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -55,6 +55,9 @@
"model": {
"options.choice1.choice1": {
"required": true,
"properties": [
"unique"
],
"value": [
"choice 2"
],
@ -67,17 +70,37 @@
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice1.choice1": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice2": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice3": {
"clearable": true,
"type": "choice"
},
"options.choice1.choice4": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -16,10 +16,10 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'choice1_leadership_value.'
else:
root = ''
api.option(root + 'options.choice1.choice1').value.set(['choice 2'])
api.option(root + 'options.choice1.choice2', 0).value.set('choice 4')
await api.option(root + 'options.choice1.choice1').value.set(['choice 2'])
await api.option(root + 'options.choice1.choice2', 0).value.set('choice 4')

View File

@ -18,11 +18,31 @@
},
"model": {
"options.choice": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice": {
"clearable": true,
"type": "choice"
},
"null": [

View File

@ -17,8 +17,25 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice": {
"clearable": true,
"type": "choice",
"displayed": {
"choice 1": "renamed 1",

View File

@ -4,11 +4,11 @@
"properties": {
"options.choice": {
"type": "choice",
"value": "hide",
"enum": [
"hide",
"show"
],
"value": "hide",
"title": "Choice description"
},
"options.unicode2": {
@ -23,13 +23,29 @@
"model": {
"options.choice": {
"required": true,
"value": "hide",
"owner": "default"
"value": "hide"
},
"options.unicode2": {
"display": false,
"hidden": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.choice": {
"clearable": true,
@ -41,13 +57,13 @@
]
},
"expected": {
"hide": {
"hide": [
"show": {
"show": [
"options.unicode2"
]
},
"show": {
"show": [
"hide": {
"hide": [
"options.unicode2"
]
}
@ -55,6 +71,7 @@
}
},
"options.unicode2": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,12 +1,14 @@
from tiramisu.option import ChoiceOption, StrOption, OptionDescription
from tiramisu import ChoiceOption, StrOption, OptionDescription, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = ChoiceOption('choice', "Choice description", ("hide", "show"), default='hide', properties=('mandatory',))
option2 = StrOption('unicode2', "Unicode 2", requires=[{'option': option1,
'expected': 'hide',
'action': 'hidden'}])
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('hide')}))
option2 = StrOption('unicode2', "Unicode 2", properties=(hidden_property,))
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("choice1_requires", "Choice with requirement", [descr1])
return descr

View File

@ -12,7 +12,27 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.date": {
"clearable": true,
"remote": true
},
"null": [
{
"title": "Configurer",

View File

@ -16,7 +16,27 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.date": {
"clearable": true,
"remote": true
},
"null": [
{
"title": "Configurer",

View File

@ -10,8 +10,25 @@
"required": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"usbpath": {
"clearable": true,
"pattern": "^[a-zA-Z0-9\\-\\._~/+]+$",
"type": "input"
},

View File

@ -24,20 +24,40 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.hostname1": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$",
"type": "input"
},
"options.hostname2": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$",
"type": "input"
},
"options.hostname3": {
"clearable": true,
"pattern": "^(?:((?!-)[a-z0-9-]{1,63})|(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$",
"type": "input"
},
"options.hostname4": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{1,15})$",
"type": "input"
},

View File

@ -5,8 +5,8 @@ def get_description():
"""
option1 = DomainnameOption('hostname1', "Domainname Description")
option2 = DomainnameOption('hostname2', "Domainname without dot Description", allow_without_dot=True)
option3 = DomainnameOption('hostname3', "Hostname or IP Description", type_='hostname', allow_ip=True)
option4 = DomainnameOption('hostname4', "Netbios Description", type_='netbios')
option3 = DomainnameOption('hostname3', "Hostname or IP Description", type='hostname', allow_ip=True)
option4 = DomainnameOption('hostname4', "Netbios Description", type='netbios')
descr1 = OptionDescription("options", "Common configuration", [option1, option2, option3, option4])
descr = OptionDescription("hostname1", "Simple hostnames", [descr1])
return descr

View File

@ -12,9 +12,26 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.ip": {
"pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
"clearable": true,
"remote": true,
"type": "input"
},
"null": [

View File

@ -16,9 +16,26 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.ip": {
"pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
"clearable": true,
"remote": true,
"type": "input"
},
"null": [

View File

@ -12,8 +12,25 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.mail": {
"clearable": true,
"pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
"type": "input"
},

View File

@ -12,8 +12,25 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.integer": {
"clearable": true,
"pattern": "^[0-9]+$",
"type": "input"
},

View File

@ -16,8 +16,25 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.integer": {
"clearable": true,
"pattern": "^[0-9]+$",
"type": "input"
},

View File

@ -18,6 +18,22 @@
"owner": "user"
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.integer": {
"clearable": true,

View File

@ -10,9 +10,9 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'number1_mod_value.'
else:
root = ''
api.option(root + 'options.integer').value.set(3)
await api.option(root + 'options.integer').value.set(3)

View File

@ -14,10 +14,25 @@
},
"model": {
"options.integer": {
"value": 0,
"owner": "default"
"value": 0
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.integer": {
"clearable": true,

View File

@ -12,8 +12,25 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -16,8 +16,25 @@
"readOnly": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -34,23 +34,52 @@
}
},
"model": {
"options.unicode.unicode": {
"options.unicode": {
"display": false,
"properties": [
"hidden"
]
},
"options.unicode.unicode": {
"required": true,
"hidden": true
"properties": [
"unique"
],
"hidden": true,
"display": false
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,15 +1,15 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True, properties=('hidden',))
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration",
[option, option1, option2, option3])
[option, option1, option2, option3], properties=('hidden',))
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leader_hidden_followers", "Leader follower with unicode and hidden leader", [descr])
return descr

View File

@ -35,20 +35,43 @@
},
"model": {
"options.unicode.unicode": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,13 +1,13 @@
from tiramisu.option import UnicodeOption, OptionDescription, Leadership
from tiramisu.option import StrOption, OptionDescription, Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])

View File

@ -6,11 +6,11 @@
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"value": [
"val1",
"val2"
],
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
@ -20,7 +20,7 @@
},
"options.unicode.unicode2": {
"type": "string",
"default": "follower2",
"defaultmulti": "follower2",
"isMulti": true,
"title": "Unicode follower 2 with default multi"
},
@ -41,29 +41,46 @@
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val1",
"val2"
],
"owner": "default"
]
},
"options.unicode.unicode2": {
"0": {
"value": "follower2",
"owner": "default"
"value": "follower2"
},
"1": {
"value": "follower2",
"owner": "default"
"value": "follower2"
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
@ -71,6 +88,7 @@
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
from tiramisu.setting import groups
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", ['val1', 'val2'], multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 with default multi", default_multi="follower2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", ['val1', 'val2'], multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2 with default multi", default_multi="follower2", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])

View File

@ -36,6 +36,9 @@
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val1",
"val2"
@ -54,22 +57,41 @@
"hidden": true
},
"null": {
"display": false,
"hidden": true
"display": false
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 hidden", multi=True, properties=('hidden',))
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2 hidden", multi=True, properties=('hidden',))
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
@ -16,10 +16,10 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_hidden.'
else:
root = ''
api.option(root + 'options.unicode.unicode').value.set([u'val1', u'val2'])
api.option(root + 'options.unicode.unicode2', 0).value.set(u'super')
await api.option(root + 'options.unicode.unicode').value.set([u'val1', u'val2'])
await api.option(root + 'options.unicode.unicode2', 0).value.set(u'super')

View File

@ -34,20 +34,43 @@
},
"model": {
"options.unicode1.unicode1": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader")
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader")
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [option, descr1])

View File

@ -38,28 +38,52 @@
"required": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"options.unicode.unicode3"
]
}
"not_equal": [
{
"options": [
"options.unicode.unicode3"
]
}
]
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"options.unicode.unicode2"
]
}
"not_equal": [
{
"options": [
"options.unicode.unicode2"
]
}
]
},
"null": [
{

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 not equal", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3 not equal", multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2 not equal", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3 not equal", multi=True)
option2.impl_add_consistency('not_equal', option3)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])

View File

@ -35,17 +35,39 @@
},
"model": {
"options.unicode.unicode": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -63,6 +85,7 @@
}
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,18 +1,17 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Values 'test' must show 'Unicode follower 3'", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Values 'test' must show 'Unicode follower 3'", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option2, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 3", properties=(hidden_property,), multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])

View File

@ -36,15 +36,36 @@
"options.unicode1": {
"properties": [
"hidden"
],
"hidden": true
]
},
"options.unicode1.unicode1": {
"required": true
"required": true,
"properties": [
"unique"
],
"hidden": true,
"display": false
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -62,12 +83,15 @@
}
},
"options.unicode1.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,19 +1,20 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Value 'test' must show Leadership")
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True)
option = StrOption('unicode', "Value 'test' must show Leadership")
option1 = StrOption('unicode1', "Unicode leader", multi=True)
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
option3 = StrOption('unicode3', "Unicode follower 2", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3], requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
[option1, option2, option3], properties=(hidden_property,))
descr = OptionDescription("options", "Common configuration", [option, descr1])
descr = OptionDescription("unicode1_leadership_requires_all", "Leader follower with requirement", [descr])
return descr

View File

@ -0,0 +1,132 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 3'"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"test",
"val2"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "test",
"owner": "user"
}
},
"options.unicode.unicode3": {
"1": {
"hidden": true,
"display": false,
"value": "super",
"owner": "user"
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode.unicode3"
]
}
}
}
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,33 @@
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option = StrOption('unicode', "Values 'test' must show 'Unicode follower 3'", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", multi=True)
disabled_property = Calculation(calc_value,
Params(ParamValue('disabled'),
kwargs={'condition': ParamOption(option, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 3", properties=(disabled_property,), multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_requires_disabled_value", "Leader followers with Unicode follower 3 disabled when Unicode follower 2 is test and modified value", [descr])
return descr
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_requires_disabled_value.'
else:
root = ''
await api.option(root + 'options.unicode.unicode').value.set([u'test', u'val2'])
await api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
await api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
await api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
await api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
await api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')

View File

@ -30,11 +30,31 @@
},
"model": {
"options.unicode1.unicode1": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1.unicode1": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -52,9 +72,11 @@
}
},
"options.unicode1.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,17 +1,17 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option1 = StrOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 2", multi=True, properties=(hidden_property,))
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])

View File

@ -31,6 +31,9 @@
"model": {
"options.unicode1.unicode1": {
"required": true,
"properties": [
"unique"
],
"value": [
"test",
"pas test"
@ -49,12 +52,30 @@
"owner": "user"
},
"1": {
"hidden": true
"hidden": true,
"display": false
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1.unicode1": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -72,9 +93,11 @@
}
},
"options.unicode1.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,29 +1,29 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option1 = StrOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 2", multi=True, properties=(hidden_property,))
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leadership_requires_follower_value", "Leader follower requires follower with leader value", [descr])
descr = OptionDescription("unicode1_leadership_requires_follower_value", "Leader follower requires follower with leader", [descr])
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_requires_follower_value.'
else:
root = ''
api.option(root + 'options.unicode1.unicode1').value.set([u'test', u'pas test'])
api.option(root + 'options.unicode1.unicode2', 0).value.set(u'super1')
api.option(root + 'options.unicode1.unicode3', 0).value.set(u'super1')
await api.option(root + 'options.unicode1.unicode1').value.set([u'test', u'pas test'])
await api.option(root + 'options.unicode1.unicode2', 0).value.set(u'super1')
await api.option(root + 'options.unicode1.unicode3', 0).value.set(u'super1')

View File

@ -30,14 +30,35 @@
},
"model": {
"options.unicode1.unicode1": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode1.unicode2": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -55,6 +76,7 @@
}
},
"options.unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,17 +1,17 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True)
option2 = UnicodeOption('unicode2', "Values 'test' must show 'Unicode follower 2'", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option1 = StrOption('unicode1', "Unicode leader", multi=True)
option2 = StrOption('unicode2', "Values 'test' must show 'Unicode follower 2'", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option2, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 2", multi=True, properties=(hidden_property,))
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])

View File

@ -1,81 +0,0 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Value 'test' must show leader"
},
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1": {
"properties": [
"hidden"
],
"hidden": true
},
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1"
]
},
"expected": {
"test": {
"show": [
"options.unicode1"
]
}
}
}
},
"options.unicode1.unicode1": {
"type": "input"
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -1,19 +0,0 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Value 'test' must show leader")
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True, requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True)
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [option, descr1])
descr = OptionDescription("unicode1_leadership_requires_leader", "Leader follower with requirement on leader", [descr])
return descr

View File

@ -36,6 +36,9 @@
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"test",
"val2"
@ -65,13 +68,31 @@
"options.unicode.unicode3": {
"1": {
"hidden": true,
"display": false,
"value": "super",
"owner": "user"
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -89,12 +110,15 @@
}
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,18 +1,18 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu import StrOption, OptionDescription, Leadership, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Values 'test' must show 'Unicode follower 3'", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option = StrOption('unicode', "Values 'test' must show 'Unicode follower 3'", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option3 = StrOption('unicode3', "Unicode follower 3", properties=(hidden_property,), multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
@ -20,14 +20,14 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_requires_value.'
else:
root = ''
api.option(root + 'options.unicode.unicode').value.set([u'test', u'val2'])
api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')
await api.option(root + 'options.unicode.unicode').value.set([u'test', u'val2'])
await api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
await api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
await api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
await api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
await api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')

View File

@ -36,20 +36,43 @@
},
"model": {
"options.unicode.unicode": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription, submulti
from tiramisu.option import StrOption, OptionDescription, submulti
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 submulti", multi=submulti)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2 submulti", multi=submulti)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])

View File

@ -6,11 +6,11 @@
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"value": [
"val1",
"val2"
],
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
@ -20,7 +20,7 @@
},
"options.unicode.unicode2": {
"type": "string",
"default": "follower2",
"defaultmulti": "follower2",
"isMulti": true,
"title": "Unicode follower 2 with default multi"
},
@ -41,6 +41,9 @@
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3",
"val4"
@ -74,12 +77,29 @@
}
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode2": {
@ -87,6 +107,7 @@
"type": "input"
},
"options.unicode.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", ['val1', 'val2'], multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 with default multi", default_multi="follower2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
option = StrOption('unicode', "Unicode leader", ['val1', 'val2'], multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2 with default multi", default_multi="follower2", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
@ -16,14 +16,14 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_value.'
else:
root = ''
api.option(root + 'options.unicode.unicode').value.set([u'val3', u'val4'])
api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')
await api.option(root + 'options.unicode.unicode').value.set([u'val3', u'val4'])
await api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
await api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
await api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
await api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
await api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')

View File

@ -1,11 +1,28 @@
{"updates": ["options.unicode.unicode",
"options.unicode.unicode1",
"options.unicode.unicode2",
"options.unicode.unicode3"],
"model": {"options.unicode.unicode": {"owner": "default",
"required": true,
"value": ["val1", "val2"]},
"options.unicode.unicode2": {"0": {"owner": "default",
"value": "follower2"},
"1": {"owner": "default",
"value": "follower2"}}}}
{
"updates": [
"options.unicode.unicode",
"options.unicode.unicode1",
"options.unicode.unicode2",
"options.unicode.unicode3"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val1",
"val2"
]
},
"options.unicode.unicode2": {
"0": {
"value": "follower2"
},
"1": {
"value": "follower2"
}
}
}
}

View File

@ -1,11 +1,32 @@
{"updates": ["options.unicode.unicode",
"options.unicode.unicode1",
"options.unicode.unicode2",
"options.unicode.unicode3"],
"model": {"options.unicode.unicode": {"required": true,
"value": ["val3"],
"owner": "user"},
"options.unicode.unicode1": {"0": {"value": "super1",
"owner": "user"}},
"options.unicode.unicode2": {"0": {"value": "pas test",
"owner": "user"}}}}
{
"updates": [
"options.unicode.unicode",
"options.unicode.unicode1",
"options.unicode.unicode2",
"options.unicode.unicode3"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
}
}
}
}

View File

@ -1,17 +1,49 @@
{"updates": ["options.unicode.unicode",
"options.unicode.unicode2"],
"model": {"options.unicode.unicode": {"required": true,
"value": ["val3", "val4", "val5"],
"owner": "user"},
"options.unicode.unicode1": {"0": {"value": "super1",
"owner": "user"},
"1": {"value": "super2",
"owner": "user"}},
"options.unicode.unicode2": {"0": {"value": "pas test",
"owner": "user"},
"1": {"value": "test",
"owner": "user"},
"2": {"value": "follower2",
"owner": "default"}},
"options.unicode.unicode3": {"1": {"value": "super",
"owner": "user"}}}}
{
"updates": [
"options.unicode.unicode",
"options.unicode.unicode2"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3",
"val4",
"val5"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "test",
"owner": "user"
},
"2": {
"value": "follower2"
}
},
"options.unicode.unicode3": {
"1": {
"value": "super",
"owner": "user"
}
}
}
}

View File

@ -1,16 +1,49 @@
{"model": {"options.unicode.unicode": {"owner": "user",
"required": true,
"value": ["val3", "val4", "val5"]},
"options.unicode.unicode1": {"0": {"owner": "user",
"value": "super1"},
"1": {"owner": "user",
"value": "super2"}},
"options.unicode.unicode2": {"0": {"owner": "user",
"value": "pas test"},
"1": {"owner": "user",
"value": "test"},
"2": {"owner": "default",
"value": "follower2"}},
"options.unicode.unicode3": {"1": {"owner": "user",
"value": "super"}}},
"updates": ["options.unicode.unicode", "options.unicode.unicode2"]}
{
"updates": [
"options.unicode.unicode",
"options.unicode.unicode2"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3",
"val4",
"val5"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "test",
"owner": "user"
},
"2": {
"value": "follower2"
}
},
"options.unicode.unicode3": {
"1": {
"value": "super",
"owner": "user"
}
}
}
}

View File

@ -1,14 +1,43 @@
{"updates": ["options.unicode.unicode2"],
"model": {"options.unicode.unicode": {"required": true,
"value": ["val3", "val4"],
"owner": "user"},
"options.unicode.unicode1": {"0": {"value": "super1",
"owner": "user"},
"1": {"value": "super2",
"owner": "user"}},
"options.unicode.unicode2": {"0": {"value": "pas test",
"owner": "user"},
"1": {"value": "follower2",
"owner": "default"}},
"options.unicode.unicode3": {"1": {"value": "super",
"owner": "user"}}}}
{
"updates": [
"options.unicode.unicode2"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3",
"val4"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "follower2"
}
},
"options.unicode.unicode3": {
"1": {
"value": "super",
"owner": "user"
}
}
}
}

View File

@ -1,14 +1,44 @@
{"updates": ["options.unicode.unicode2"],
"model": {"options.unicode.unicode": {"required": true,
"value": ["val3", "val4"],
"owner": "user"},
"options.unicode.unicode1": {"0": {"value": "super1",
"owner": "user"},
"1": {"value": "super2",
"owner": "user"}},
"options.unicode.unicode2": {"0": {"value": "pas test",
"owner": "user"},
"1": {"value": "test2",
"owner": "user"}},
"options.unicode.unicode3": {"1": {"value": "super",
"owner": "user"}}}}
{
"updates": [
"options.unicode.unicode2"
],
"model": {
"options.unicode.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val3",
"val4"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "test2",
"owner": "user"
}
},
"options.unicode.unicode3": {
"1": {
"value": "super",
"owner": "user"
}
}
}
}

View File

@ -16,8 +16,25 @@
"required": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,11 +1,11 @@
"""just a multi unicode option
"""
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode 1", properties=('mandatory',))
option = StrOption('unicode', "Unicode 1", properties=('mandatory',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_mandatory", "Mandatory unicode", [descr1])
return descr

View File

@ -17,8 +17,25 @@
"owner": "user"
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -11,9 +11,9 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_mod_value.'
else:
root = ''
api.option(root + 'options.unicode').value.set('a')
await api.option(root + 'options.unicode').value.set('a')

View File

@ -14,11 +14,31 @@
},
"model": {
"options.unicode": {
"required": true
"required": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,11 +1,11 @@
"""just a multi unicode option
"""
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Multi string 1", multi=True)
option = StrOption('unicode', "Multi string 1", multi=True)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_multi", "Multi unicode", [descr1])
return descr

View File

@ -1,4 +1,17 @@
{"updates": ["options.unicode"],
"model": {"options.unicode": {"owner": "user",
"required": true,
"value": ["val"]}}}
{
"updates": [
"options.unicode"
],
"model": {
"options.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"val"
],
"owner": "user"
}
}
}

View File

@ -14,13 +14,33 @@
},
"model": {
"options.unicode": {
"display": false,
"required": true,
"properties": [
"unique"
],
"display": false,
"hidden": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,11 +1,11 @@
"""just a multi unicode option
"""
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode 1", properties=('hidden',), multi=True)
option = StrOption('unicode', "Unicode 1", properties=('hidden',), multi=True)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_multi_hidden", "Hidden multi unicode", [descr1])
return descr

View File

@ -15,11 +15,31 @@
"model": {
"options.unicode": {
"required": true,
"needs_len": true
"needs_len": true,
"properties": [
"unique"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,11 +1,11 @@
"""just a multi unicode option
"""
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode 1", multi=True, properties=('mandatory',))
option = StrOption('unicode', "Unicode 1", multi=True, properties=('mandatory',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_multi_mandatory", "Mandatory multi Unicode", [descr1])
return descr

View File

@ -4,11 +4,11 @@
"properties": {
"options.unicode": {
"type": "string",
"isMulti": true,
"value": [
"a",
"b"
],
"isMulti": true,
"title": "String 1"
}
},
@ -19,6 +19,9 @@
"model": {
"options.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"c",
"d",
@ -27,6 +30,22 @@
"owner": "user"
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,

View File

@ -11,9 +11,9 @@ def get_description():
return descr
def get_values(api, allpath=False):
async def get_values(api, allpath=False):
if allpath:
root = 'unicode1_multi_mod_value.'
else:
root = ''
api.option(root + 'options.unicode').value.set(['c', 'd', 'e'])
await api.option(root + 'options.unicode').value.set(['c', 'd', 'e'])

View File

@ -1,4 +1,17 @@
{"updates": ["options.unicode"],
"model": {"options.unicode": {"owner": "default",
"required": true,
"value": ["a", "b"]}}}
{
"updates": [
"options.unicode"
],
"model": {
"options.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"a",
"b"
]
}
}
}

View File

@ -1,4 +1,19 @@
{"updates": ["options.unicode"],
"model": {"options.unicode": {"owner": "user",
"required": true,
"value": ["c", "f", "e"]}}}
{
"updates": [
"options.unicode"
],
"model": {
"options.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"c",
"f",
"e"
],
"owner": "user"
}
}
}

View File

@ -24,11 +24,11 @@
},
"descr2.unicode2_multi": {
"type": "string",
"isMulti": true,
"value": [
"a",
"b"
],
"isMulti": true,
"title": "Multi unicode 2"
}
},
@ -56,77 +56,107 @@
"required": true
},
"descr2.unicode2": {
"value": "a",
"owner": "default"
"value": "a"
},
"descr2.unicode2_multi": {
"required": true,
"value": [
"a",
"b"
],
"owner": "default"
]
},
"descr3.unicode3_multi": {
"required": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"descr1.unicode1": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr2.unicode2",
"descr3.unicode3"
]
}
"not_equal": [
{
"options": [
"descr2.unicode2",
"descr3.unicode3"
]
}
]
},
"descr1.unicode1_multi": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr2.unicode2_multi",
"descr3.unicode3_multi"
]
}
"not_equal": [
{
"options": [
"descr2.unicode2_multi",
"descr3.unicode3_multi"
]
}
]
},
"descr2.unicode2": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr1.unicode1",
"descr3.unicode3"
]
}
"not_equal": [
{
"options": [
"descr1.unicode1",
"descr3.unicode3"
]
}
]
},
"descr2.unicode2_multi": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr1.unicode1_multi",
"descr3.unicode3_multi"
]
}
"not_equal": [
{
"options": [
"descr1.unicode1_multi",
"descr3.unicode3_multi"
]
}
]
},
"descr3.unicode3": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr1.unicode1",
"descr2.unicode2"
]
}
"not_equal": [
{
"options": [
"descr1.unicode1",
"descr2.unicode2"
]
}
]
},
"descr3.unicode3_multi": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"descr1.unicode1_multi",
"descr2.unicode2_multi"
]
}
"not_equal": [
{
"options": [
"descr1.unicode1_multi",
"descr2.unicode2_multi"
]
}
]
},
"null": [
{

View File

@ -1,14 +1,14 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Unicode 1, not equal to 'a'")
option2 = UnicodeOption('unicode1_multi', "Multi unicode 1, not equal to 'a' or 'b'", multi=True)
option3 = UnicodeOption('unicode2', "Unicode 2", default='a')
option4 = UnicodeOption('unicode2_multi', "Multi unicode 2", multi=True, default=['a', 'b'])
option5 = UnicodeOption('unicode3', "Unicode 3")
option6 = UnicodeOption('unicode3_multi', "Multi unicode 3", multi=True)
option1 = StrOption('unicode1', "Unicode 1, not equal to 'a'")
option2 = StrOption('unicode1_multi', "Multi unicode 1, not equal to 'a' or 'b'", multi=True)
option3 = StrOption('unicode2', "Unicode 2", default='a')
option4 = StrOption('unicode2_multi', "Multi unicode 2", multi=True, default=['a', 'b'])
option5 = StrOption('unicode3', "Unicode 3")
option6 = StrOption('unicode3_multi', "Multi unicode 3", multi=True)
#option1.impl_add_consistency('not_equal', option3, option5)
#option2.impl_add_consistency('not_equal', option4, option6)
option3.impl_add_consistency('not_equal', option1)

View File

@ -19,11 +19,32 @@
"model": {
"options.unicode2": {
"required": true,
"hidden": true
"properties": [
"unique"
],
"hidden": true,
"display": false
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -41,6 +62,7 @@
}
},
"options.unicode2": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,15 +1,16 @@
from tiramisu.option import StrOption, OptionDescription
from tiramisu import StrOption, OptionDescription, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = StrOption('unicode1', "Value 'test' must show Unicode 2")
option2 = StrOption('unicode2', "Unicode 2", requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option2 = StrOption('unicode2', "Unicode 2", properties=(hidden_property,), multi=True)
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("unicode1_multi_requires", "Unicode multi with requirement", [descr1])
return descr

View File

@ -4,11 +4,11 @@
"properties": {
"options.unicode": {
"type": "string",
"isMulti": true,
"value": [
"a",
"b"
],
"isMulti": true,
"title": "String 1"
}
},
@ -19,13 +19,31 @@
"model": {
"options.unicode": {
"required": true,
"properties": [
"unique"
],
"value": [
"a",
"b"
],
"owner": "default"
]
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode": {
"clearable": true,

View File

@ -1,11 +1,11 @@
"""just a multi unicode option
"""
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "String 1", ['a', 'b'], multi=True)
option = StrOption('unicode', "String 1", ['a', 'b'], multi=True)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_multi_value", "Multi unicode with default value 'a' and 'b'", [descr1])
return descr

View File

@ -16,22 +16,44 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"options.unicode2"
]
}
"not_equal": [
{
"options": [
"options.unicode2"
]
}
]
},
"options.unicode2": {
"clearable": true,
"type": "input",
"not_equal": {
"options": [
"options.unicode1"
]
}
"not_equal": [
{
"options": [
"options.unicode1"
]
}
]
},
"null": [
{

View File

@ -1,10 +1,10 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Unicode 1")
option2 = UnicodeOption('unicode2', "Unicode 2")
option1 = StrOption('unicode1', "Unicode 1")
option2 = StrOption('unicode2', "Unicode 2")
option2.impl_add_consistency('not_equal', option1)
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("unicode1_not_equal", "Unicode 1 and unicode 2 not equal", [descr1])

View File

@ -29,12 +29,36 @@
"unicode1": {
"properties": [
"hidden"
],
"hidden": true
]
},
"unicode1.unicode2": {
"hidden": true,
"display": false
},
"unicode1.unicode3": {
"hidden": true,
"display": false
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -52,9 +76,11 @@
}
},
"unicode1.unicode2": {
"clearable": true,
"type": "input"
},
"unicode1.unicode3": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,17 +1,18 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import StrOption, OptionDescription, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Value 'test' must show OptionDescription")
option1 = StrOption('unicode1', "Value 'test' must show OptionDescription")
descr1 = OptionDescription("options", "Common configuration", [option1])
option2 = UnicodeOption('unicode2', "Unicode 2")
option3 = UnicodeOption('unicode3', "Unicode 3")
descr2 = OptionDescription("unicode1", "OptionDescription with 2 options",
[option2, option3], requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option2 = StrOption('unicode2', "Unicode 2")
option3 = StrOption('unicode3', "Unicode 3")
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
descr2 = OptionDescription("unicode1", "OptionDescription with 2 options", [option2, option3], properties=(hidden_property,))
descr = OptionDescription("unicode1_optiondescription_requires", "OptionDesciption with requirement", [descr1, descr2])
return descr

View File

@ -17,11 +17,29 @@
},
"model": {
"options.unicode2": {
"display": false,
"hidden": true
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input",
"dependencies": {
"default": {
@ -39,6 +57,7 @@
}
},
"options.unicode2": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -1,14 +1,16 @@
from tiramisu.option import StrOption, OptionDescription
from tiramisu import StrOption, OptionDescription, Calculation, ParamValue, ParamOption, Params, calc_value
def get_description():
"""generate description for this test
"""
option1 = StrOption('unicode1', "Value 'test' must show Unicode 2")
option2 = StrOption('unicode2', "Unicode 2", requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
hidden_property = Calculation(calc_value,
Params(ParamValue('hidden'),
kwargs={'condition': ParamOption(option1, todict=True),
'expected': ParamValue('test'),
'reverse_condition': ParamValue(True)}))
option2 = StrOption('unicode2', "Unicode 2", properties=(hidden_property,))
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("unicode1_requires", "Unicode with requirement", [descr1])
return descr

View File

@ -14,14 +14,29 @@
},
"model": {
"options.unicode1": {
"value": "word",
"owner": "default"
"value": "word"
}
},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"type": "input",
"clearable": true
"clearable": true,
"type": "input"
},
"null": [
{

View File

@ -16,11 +16,29 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input"
},
"options.unicode2": {
"clearable": true,
"type": "input"
},
"null": [

View File

@ -16,16 +16,33 @@
}
},
"model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input",
"copy": [
"options.unicode2"
]
},
"options.unicode2": {
"type": "input",
"clearable": true
"clearable": true,
"type": "input"
},
"null": [
{

Some files were not shown because too many files have changed in this diff Show More