Compare commits
18 Commits
release/3.
...
release/3.
Author | SHA1 | Date | |
---|---|---|---|
4df36a5548 | |||
aa11e3b79c | |||
07e6ea5eb2 | |||
e7cbd7849a | |||
b9e9e98270 | |||
a774378732 | |||
5498a12b2b | |||
552cd3740d | |||
5ea35bf84e | |||
6d0d233d9b | |||
829247e79f | |||
63094f7e54 | |||
1aec891408 | |||
48b3b7e8a4 | |||
4dbb82ed3f | |||
97b75660c5 | |||
06f501ad05 | |||
2b45955886 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,5 +3,4 @@
|
||||
*.pyc
|
||||
*.mo
|
||||
*.swp
|
||||
version.in
|
||||
build/
|
||||
|
19
ChangeLog
19
ChangeLog
@ -1,4 +1,21 @@
|
||||
Sun Mar 24 20:24:34 2019
|
||||
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
|
||||
* add new config with mixconfig type
|
||||
|
||||
Mon Apr 8 08:40:10 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
|
||||
* version 3.0 rc6
|
||||
* import tiramisu-json in tiramisu repository
|
||||
|
||||
Fri Apr 5 20:57:05 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
|
||||
* version 3.0 rc4 and rc5
|
||||
* change filename/directory name with Python Packaging Autority
|
||||
recommendations
|
||||
* do not change Config contexts properties when reload in MetaConfig
|
||||
(fixes #7)
|
||||
* add/remove config in mixconfig or metaconfig (fixes #6)
|
||||
|
||||
Sun Mar 24 20:24:34 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
|
||||
* version 3.0 rc3
|
||||
* corrections in debug logger
|
||||
* requirement can have callback
|
||||
|
8
MANIFEST.in
Normal file
8
MANIFEST.in
Normal file
@ -0,0 +1,8 @@
|
||||
# Include the README
|
||||
include *.rst
|
||||
|
||||
# Include the license file
|
||||
include LICENSE.txt
|
||||
|
||||
# Include the data files
|
||||
recursive-include tiramisu *.py *.mo
|
14
Makefile
14
Makefile
@ -10,7 +10,7 @@ INSTALL_DATA := install -m 644
|
||||
INSTALL_PROGRAM := install -m 755
|
||||
INSTALL_DIR := install -m 755 -d
|
||||
|
||||
TRADUC_DIR = translations
|
||||
TRADUC_DIR = tiramisu/locale
|
||||
TRADUC_DEST = $(DESTDIR)/usr/share/locale
|
||||
|
||||
PYTHON_OPTS =
|
||||
@ -26,7 +26,7 @@ define gettext
|
||||
else \
|
||||
P="pygettext.py" ; \
|
||||
fi ; \
|
||||
$$P -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
|
||||
$$P -p $(TRADUC_DIR)/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
|
||||
endef
|
||||
|
||||
# Build translation files
|
||||
@ -69,12 +69,12 @@ build-pot:
|
||||
build-lang:
|
||||
$(call build_translation, $(TRADUC_DIR))
|
||||
|
||||
install-lang:
|
||||
$(INSTALL_DIR) $(TRADUC_DEST)
|
||||
$(call install_translation, $(TRADUC_DIR))
|
||||
# install-lang:
|
||||
# $(INSTALL_DIR) $(TRADUC_DEST)
|
||||
# $(call install_translation, $(TRADUC_DIR))
|
||||
|
||||
install: install-lang
|
||||
python setup.py install --no-compile $(PYTHON_OPTS)
|
||||
install: # install-lang
|
||||
python3 setup.py install --no-compile $(PYTHON_OPTS)
|
||||
|
||||
dist:
|
||||
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz
|
||||
|
17
pyproject.toml
Normal file
17
pyproject.toml
Normal file
@ -0,0 +1,17 @@
|
||||
[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"
|
55
setup.py
55
setup.py
@ -1,57 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from distutils.core import setup
|
||||
from setuptools import setup, find_packages
|
||||
from os.path import dirname, abspath, join, normpath, isdir
|
||||
from os import listdir
|
||||
import os
|
||||
from tiramisu import __version__
|
||||
|
||||
|
||||
package_name = os.environ.get('PACKAGE_DST', 'tiramisu')
|
||||
|
||||
def fetch_version():
|
||||
"""Get version from version.in"""
|
||||
return open('VERSION', 'r').readline().strip()
|
||||
|
||||
|
||||
def return_files(component):
|
||||
here = dirname(abspath(__file__))
|
||||
path = normpath(join(here, 'tiramisu', component))
|
||||
dir_content = [content for content in listdir(path)
|
||||
if not content == '__pycache__']
|
||||
paths = filter(isdir, [join(path, content)
|
||||
for content in dir_content])
|
||||
lst = ['.'.join(path.split('/')[-3:]) for path in paths]
|
||||
#lst = [package_name + '.' + '.'.join(path.split('/')[-2:]) for path in paths]
|
||||
return lst
|
||||
|
||||
|
||||
packages = [package_name, package_name + '.storage', package_name + '.option']
|
||||
packages.extend(return_files('storage'))
|
||||
packages.extend(return_files('option'))
|
||||
|
||||
if package_name != 'tiramisu':
|
||||
package_dir = {package_name: 'tiramisu'}
|
||||
else:
|
||||
package_dir = {}
|
||||
PACKAGE_NAME = os.environ.get('PACKAGE_DST', 'tiramisu')
|
||||
|
||||
setup(
|
||||
version=__version__,
|
||||
author="Tiramisu's team",
|
||||
author_email='contact@cadoles.com',
|
||||
name=package_name,
|
||||
version=fetch_version(),
|
||||
author_email='gnunux@gnunux.info',
|
||||
name=PACKAGE_NAME,
|
||||
description='an options controller tool',
|
||||
url='http://tiramisu.labs.libre-entreprise.org/',
|
||||
url='https://framagit.org/tiramisu/tiramisu',
|
||||
license='GNU Library or Lesser General Public License (LGPL)',
|
||||
classifiers=[
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 2",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Development Status :: 4 - Beta",
|
||||
"Environment :: Other Environment",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
||||
"Operating System :: OS Independent",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Topic :: Text Processing :: Linguistic"
|
||||
"Natural Language :: English",
|
||||
"Natural Language :: French",
|
||||
],
|
||||
long_description="""\
|
||||
An options controller tool
|
||||
@ -67,8 +38,8 @@ Tiramisu is an options handler and an options controller, wich aims at
|
||||
producing flexible and fast options access.
|
||||
|
||||
|
||||
This version requires Python 2.6 or later.
|
||||
This version requires Python 3.5 or later.
|
||||
""",
|
||||
packages=packages,
|
||||
package_dir=package_dir
|
||||
include_package_data=True,
|
||||
packages=find_packages(include=['tiramisu'])
|
||||
)
|
||||
|
0
tests/dict/__init__.py
Normal file
0
tests/dict/__init__.py
Normal file
0
tests/dict/data/__init__.py
Normal file
0
tests/dict/data/__init__.py
Normal file
24
tests/dict/data/boolean1.json
Normal file
24
tests/dict/data/boolean1.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.boolean": {
|
||||
"type": "boolean",
|
||||
"title": "Boolean 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
12
tests/dict/data/boolean1.py
Normal file
12
tests/dict/data/boolean1.py
Normal file
@ -0,0 +1,12 @@
|
||||
"""just an boolean option
|
||||
"""
|
||||
from tiramisu.option import BoolOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = BoolOption('boolean', "Boolean 1")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("boolean1", "Simple boolean", [descr1])
|
||||
return descr
|
||||
|
28
tests/dict/data/boolean1_frozen.json
Normal file
28
tests/dict/data/boolean1_frozen.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.boolean": {
|
||||
"type": "boolean",
|
||||
"title": "Boolean 1 frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.boolean": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
12
tests/dict/data/boolean1_frozen.py
Normal file
12
tests/dict/data/boolean1_frozen.py
Normal file
@ -0,0 +1,12 @@
|
||||
"""just an boolean option
|
||||
"""
|
||||
from tiramisu.option import BoolOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = BoolOption('boolean', "Boolean 1 frozen", properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("boolean1_frozen", "Simple boolean", [descr1])
|
||||
return descr
|
||||
|
32
tests/dict/data/choice1.json
Normal file
32
tests/dict/data/choice1.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"enum": [
|
||||
"",
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.choice": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/choice1.py
Normal file
10
tests/dict/data/choice1.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("choice1", "Simple choice", [descr1])
|
||||
return descr
|
36
tests/dict/data/choice1_frozen.json
Normal file
36
tests/dict/data/choice1_frozen.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"enum": [
|
||||
"",
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/choice1_frozen.py
Normal file
10
tests/dict/data/choice1_frozen.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice', "Choice description frozen", ("choice 1", "choice 2"), properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("choice1_frozen", "Simple choice", [descr1])
|
||||
return descr
|
81
tests/dict/data/choice1_leadership.json
Normal file
81
tests/dict/data/choice1_leadership.json
Normal file
@ -0,0 +1,81 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice1": {
|
||||
"properties": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description leader"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 3",
|
||||
"choice 4"
|
||||
],
|
||||
"title": "Choice description follower 1"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 5",
|
||||
"choice 6"
|
||||
],
|
||||
"title": "Choice description follower 2"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 7",
|
||||
"choice 8"
|
||||
],
|
||||
"title": "Choice description follower 3"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration 2"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
16
tests/dict/data/choice1_leadership.py
Normal file
16
tests/dict/data/choice1_leadership.py
Normal file
@ -0,0 +1,16 @@
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice1', "Choice description leader", ("choice 1", "choice 2"), multi=True)
|
||||
option1 = ChoiceOption('choice2', "Choice description follower 1", ("choice 3", "choice 4"), multi=True)
|
||||
option2 = ChoiceOption('choice3', "Choice description follower 2", ("choice 5", "choice 6"), multi=True)
|
||||
option3 = ChoiceOption('choice4', "Choice description follower 3", ("choice 7", "choice 8"), multi=True)
|
||||
descr1 = Leadership("choice1", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("choice1_leadership", "Leader followers with choice", [descr])
|
||||
return descr
|
87
tests/dict/data/choice1_leadership_hidden.json
Normal file
87
tests/dict/data/choice1_leadership_hidden.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice1": {
|
||||
"properties": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description leader"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 3",
|
||||
"choice 4"
|
||||
],
|
||||
"title": "Choice description follower 1"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 5",
|
||||
"choice 6"
|
||||
],
|
||||
"title": "Choice description follower 2 hidden"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 7",
|
||||
"choice 8"
|
||||
],
|
||||
"title": "Choice description follower 3"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Slave 2 is hidden"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration 2"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"null": {
|
||||
"display": false,
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
16
tests/dict/data/choice1_leadership_hidden.py
Normal file
16
tests/dict/data/choice1_leadership_hidden.py
Normal file
@ -0,0 +1,16 @@
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
from tiramisu.setting import groups
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice1', "Choice description leader", ("choice 1", "choice 2"), multi=True)
|
||||
option1 = ChoiceOption('choice2', "Choice description follower 1", ("choice 3", "choice 4"), multi=True)
|
||||
option2 = ChoiceOption('choice3', "Choice description follower 2 hidden", ("choice 5", "choice 6"), multi=True, properties=('hidden',))
|
||||
option3 = ChoiceOption('choice4', "Choice description follower 3", ("choice 7", "choice 8"), multi=True)
|
||||
descr1 = Leadership("choice1", "Slave 2 is hidden",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("choice1_leadership_hidden", "Leader follower with choice, one is hidden", [descr])
|
||||
return descr
|
91
tests/dict/data/choice1_leadership_value.json
Normal file
91
tests/dict/data/choice1_leadership_value.json
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice1": {
|
||||
"properties": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice leader"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 3",
|
||||
"choice 4"
|
||||
],
|
||||
"title": "Choice follower 1"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 5",
|
||||
"choice 6"
|
||||
],
|
||||
"title": "Choice follower 2"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"",
|
||||
"choice 7",
|
||||
"choice 8"
|
||||
],
|
||||
"title": "Choice follower 3"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration 2"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true,
|
||||
"value": [
|
||||
"choice 2"
|
||||
],
|
||||
"owner": "user"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"0": {
|
||||
"value": "choice 4",
|
||||
"owner": "user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice1.choice1": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice2": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"type": "choice"
|
||||
},
|
||||
"options.choice1.choice4": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
25
tests/dict/data/choice1_leadership_value.py
Normal file
25
tests/dict/data/choice1_leadership_value.py
Normal file
@ -0,0 +1,25 @@
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice1', "Choice leader", ("choice 1", "choice 2"), multi=True)
|
||||
option1 = ChoiceOption('choice2', "Choice follower 1", ("choice 3", "choice 4"), multi=True)
|
||||
option2 = ChoiceOption('choice3', "Choice follower 2", ("choice 5", "choice 6"), multi=True)
|
||||
option3 = ChoiceOption('choice4', "Choice follower 3", ("choice 7", "choice 8"), multi=True)
|
||||
descr1 = Leadership("choice1", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("choice1_leadership_value", "Leader followers with choices, leader is 'choice 2' and follower 1 is 'choice 4'", [descr])
|
||||
return descr
|
||||
|
||||
|
||||
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')
|
36
tests/dict/data/choice1_multi.json
Normal file
36
tests/dict/data/choice1_multi.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"isMulti": true,
|
||||
"enum": [
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice": {
|
||||
"type": "choice"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/choice1_multi.py
Normal file
10
tests/dict/data/choice1_multi.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"), multi=True)
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("choice1_multi", "Multi choice", [descr1])
|
||||
return descr
|
36
tests/dict/data/choice1_rename.json
Normal file
36
tests/dict/data/choice1_rename.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"enum": [
|
||||
"",
|
||||
"choice 1",
|
||||
"choice 2"
|
||||
],
|
||||
"title": "Choice description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"displayed": {
|
||||
"choice 1": "renamed 1",
|
||||
"choice 2": "renamed 2"
|
||||
}
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
20
tests/dict/data/choice1_rename.py
Normal file
20
tests/dict/data/choice1_rename.py
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
from tiramisu.option import ChoiceOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("choice1_rename", "Rename displayed value", [descr1])
|
||||
return descr
|
||||
|
||||
|
||||
def get_form(allpath=False):
|
||||
key = 'options.choice'
|
||||
if allpath:
|
||||
key = 'choice1_rename.' + key
|
||||
return [{'key': key,
|
||||
'displayed': {'choice 1': 'renamed 1',
|
||||
'choice 2': 'renamed 2'}
|
||||
}]
|
68
tests/dict/data/choice1_requires.json
Normal file
68
tests/dict/data/choice1_requires.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.choice": {
|
||||
"type": "choice",
|
||||
"value": "hide",
|
||||
"enum": [
|
||||
"hide",
|
||||
"show"
|
||||
],
|
||||
"title": "Choice description"
|
||||
},
|
||||
"options.unicode2": {
|
||||
"type": "string",
|
||||
"title": "Unicode 2"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.choice": {
|
||||
"required": true,
|
||||
"value": "hide",
|
||||
"owner": "default"
|
||||
},
|
||||
"options.unicode2": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.choice": {
|
||||
"clearable": true,
|
||||
"type": "choice",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"show": [
|
||||
"options.unicode2"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"hide": {
|
||||
"hide": [
|
||||
"options.unicode2"
|
||||
]
|
||||
},
|
||||
"show": {
|
||||
"show": [
|
||||
"options.unicode2"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
12
tests/dict/data/choice1_requires.py
Normal file
12
tests/dict/data/choice1_requires.py
Normal file
@ -0,0 +1,12 @@
|
||||
from tiramisu.option import ChoiceOption, StrOption, OptionDescription
|
||||
|
||||
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'}])
|
||||
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
|
||||
descr = OptionDescription("choice1_requires", "Choice with requirement", [descr1])
|
||||
return descr
|
24
tests/dict/data/date1.json
Normal file
24
tests/dict/data/date1.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.date": {
|
||||
"type": "date",
|
||||
"title": "Date description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
9
tests/dict/data/date1.py
Normal file
9
tests/dict/data/date1.py
Normal file
@ -0,0 +1,9 @@
|
||||
from tiramisu.option import DateOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = DateOption('date', "Date description")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("date1", "Simple date", [descr1])
|
||||
return descr
|
28
tests/dict/data/date1_frozen.json
Normal file
28
tests/dict/data/date1_frozen.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.date": {
|
||||
"type": "date",
|
||||
"title": "Date description frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.date": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
9
tests/dict/data/date1_frozen.py
Normal file
9
tests/dict/data/date1_frozen.py
Normal file
@ -0,0 +1,9 @@
|
||||
from tiramisu.option import DateOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = DateOption('date', "Date description frozen", properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("date1_frozen", "Simple date", [descr1])
|
||||
return descr
|
26
tests/dict/data/filename1.json
Normal file
26
tests/dict/data/filename1.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"schema": {
|
||||
"usbpath": {
|
||||
"type": "filename",
|
||||
"title": "Chemin d'acc\u00e8s"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"usbpath": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"usbpath": {
|
||||
"pattern": "^[a-zA-Z0-9\\-\\._~/+]+$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
6
tests/dict/data/filename1.py
Normal file
6
tests/dict/data/filename1.py
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from tiramisu.option import FilenameOption, OptionDescription
|
||||
def get_description():
|
||||
usbpath = FilenameOption('usbpath', "Chemin d'accès", properties=('mandatory',))
|
||||
descr = OptionDescription("filename1", "Simple filename", [usbpath])
|
||||
return descr
|
52
tests/dict/data/hostname1.json
Normal file
52
tests/dict/data/hostname1.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.hostname1": {
|
||||
"type": "domainname",
|
||||
"title": "Domainname Description"
|
||||
},
|
||||
"options.hostname2": {
|
||||
"type": "domainname",
|
||||
"title": "Domainname without dot Description"
|
||||
},
|
||||
"options.hostname3": {
|
||||
"type": "domainname",
|
||||
"title": "Hostname or IP Description"
|
||||
},
|
||||
"options.hostname4": {
|
||||
"type": "domainname",
|
||||
"title": "Netbios Description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.hostname1": {
|
||||
"pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$",
|
||||
"type": "input"
|
||||
},
|
||||
"options.hostname2": {
|
||||
"pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$",
|
||||
"type": "input"
|
||||
},
|
||||
"options.hostname3": {
|
||||
"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": {
|
||||
"pattern": "^((?!-)[a-z0-9-]{1,15})$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
12
tests/dict/data/hostname1.py
Normal file
12
tests/dict/data/hostname1.py
Normal file
@ -0,0 +1,12 @@
|
||||
from tiramisu.option import DomainnameOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
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')
|
||||
descr1 = OptionDescription("options", "Common configuration", [option1, option2, option3, option4])
|
||||
descr = OptionDescription("hostname1", "Simple hostnames", [descr1])
|
||||
return descr
|
28
tests/dict/data/ip1.json
Normal file
28
tests/dict/data/ip1.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.ip": {
|
||||
"type": "ip",
|
||||
"title": "IP Description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"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]?)$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
9
tests/dict/data/ip1.py
Normal file
9
tests/dict/data/ip1.py
Normal file
@ -0,0 +1,9 @@
|
||||
from tiramisu.option import IPOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option1 = IPOption('ip', "IP Description")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option1])
|
||||
descr = OptionDescription("ip1", "Simple IP", [descr1])
|
||||
return descr
|
32
tests/dict/data/ip1_frozen.json
Normal file
32
tests/dict/data/ip1_frozen.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.ip": {
|
||||
"type": "ip",
|
||||
"title": "IP Description frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.ip": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"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]?)$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
9
tests/dict/data/ip1_frozen.py
Normal file
9
tests/dict/data/ip1_frozen.py
Normal file
@ -0,0 +1,9 @@
|
||||
from tiramisu.option import IPOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option1 = IPOption('ip', "IP Description frozen", properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option1])
|
||||
descr = OptionDescription("ip1_frozen", "Simple IP", [descr1])
|
||||
return descr
|
28
tests/dict/data/mail1.json
Normal file
28
tests/dict/data/mail1.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.mail": {
|
||||
"type": "email",
|
||||
"title": "Mail Description"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.mail": {
|
||||
"pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/mail1.py
Normal file
10
tests/dict/data/mail1.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import EmailOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = EmailOption('mail', "Mail Description")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("mail1", "Simple mail", [descr1])
|
||||
return descr
|
28
tests/dict/data/number1.json
Normal file
28
tests/dict/data/number1.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.integer": {
|
||||
"type": "integer",
|
||||
"title": "integer 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.integer": {
|
||||
"pattern": "^[0-9]+$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/number1.py
Normal file
10
tests/dict/data/number1.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import IntOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = IntOption('integer', "integer 1")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("number1", "Simple number", [descr1])
|
||||
return descr
|
32
tests/dict/data/number1_frozen.json
Normal file
32
tests/dict/data/number1_frozen.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.integer": {
|
||||
"type": "integer",
|
||||
"title": "integer 1 frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.integer": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.integer": {
|
||||
"pattern": "^[0-9]+$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
10
tests/dict/data/number1_frozen.py
Normal file
10
tests/dict/data/number1_frozen.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from tiramisu.option import IntOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = IntOption('integer', "integer 1 frozen", properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("number1_frozen", "Simple number", [descr1])
|
||||
return descr
|
35
tests/dict/data/number1_mod_value.json
Normal file
35
tests/dict/data/number1_mod_value.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.integer": {
|
||||
"type": "integer",
|
||||
"value": 0,
|
||||
"title": "integer 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.integer": {
|
||||
"value": 3,
|
||||
"owner": "user"
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.integer": {
|
||||
"clearable": true,
|
||||
"pattern": "^[0-9]+$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
18
tests/dict/data/number1_mod_value.py
Normal file
18
tests/dict/data/number1_mod_value.py
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
from tiramisu.option import IntOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = IntOption('integer', "integer 1", 0)
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("number1_mod_value", "Number with modified value 3 and default value 0", [descr1])
|
||||
return descr
|
||||
|
||||
|
||||
def get_values(api, allpath=False):
|
||||
if allpath:
|
||||
root = 'number1_mod_value.'
|
||||
else:
|
||||
root = ''
|
||||
api.option(root + 'options.integer').value.set(3)
|
35
tests/dict/data/number1_value.json
Normal file
35
tests/dict/data/number1_value.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.integer": {
|
||||
"type": "integer",
|
||||
"value": 0,
|
||||
"title": "integer 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.integer": {
|
||||
"value": 0,
|
||||
"owner": "default"
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.integer": {
|
||||
"clearable": true,
|
||||
"pattern": "^[0-9]+$",
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
11
tests/dict/data/number1_value.py
Normal file
11
tests/dict/data/number1_value.py
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
from tiramisu.option import IntOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = IntOption('integer', "integer 1", 0)
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("number1_value", "Number with value 0", [descr1])
|
||||
return descr
|
||||
|
1
tests/dict/data/unicode1.dict
Normal file
1
tests/dict/data/unicode1.dict
Normal file
@ -0,0 +1 @@
|
||||
{"options.unicode": null}
|
1
tests/dict/data/unicode1.dict1
Normal file
1
tests/dict/data/unicode1.dict1
Normal file
@ -0,0 +1 @@
|
||||
{"options.unicode": "val"}
|
27
tests/dict/data/unicode1.json
Normal file
27
tests/dict/data/unicode1.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"type": "string",
|
||||
"title": "Unicode 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {},
|
||||
"form": {
|
||||
"options.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
5
tests/dict/data/unicode1.mod1
Normal file
5
tests/dict/data/unicode1.mod1
Normal file
@ -0,0 +1,5 @@
|
||||
{"cmd": "config.option('options.unicode').value.set('val')",
|
||||
"body": {"updates": [{"action": "modify",
|
||||
"name": "options.unicode",
|
||||
"value": "val"}]}
|
||||
}
|
11
tests/dict/data/unicode1.py
Normal file
11
tests/dict/data/unicode1.py
Normal file
@ -0,0 +1,11 @@
|
||||
"""just an unicode option
|
||||
"""
|
||||
from tiramisu.option import StrOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = StrOption('unicode', "Unicode 1")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("unicode1", "Simple unicode", [descr1])
|
||||
return descr
|
3
tests/dict/data/unicode1.updates1
Normal file
3
tests/dict/data/unicode1.updates1
Normal file
@ -0,0 +1,3 @@
|
||||
{"updates": ["options.unicode"],
|
||||
"model": {"options.unicode": {"owner": "user",
|
||||
"value": "val"}}}
|
31
tests/dict/data/unicode1_frozen.json
Normal file
31
tests/dict/data/unicode1_frozen.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"type": "string",
|
||||
"title": "Unicode 1 frozen"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
11
tests/dict/data/unicode1_frozen.py
Normal file
11
tests/dict/data/unicode1_frozen.py
Normal file
@ -0,0 +1,11 @@
|
||||
"""just an unicode option
|
||||
"""
|
||||
from tiramisu.option import StrOption, OptionDescription
|
||||
|
||||
def get_description():
|
||||
"""generate description for this test
|
||||
"""
|
||||
option = StrOption('unicode', "Unicode 1 frozen", properties=('frozen',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("unicode1_frozen", "Simple unicode", [descr1])
|
||||
return descr
|
64
tests/dict/data/unicode1_leader_hidden_followers.json
Normal file
64
tests/dict/data/unicode1_leader_hidden_followers.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"display": false,
|
||||
"required": true,
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
15
tests/dict/data/unicode1_leader_hidden_followers.py
Normal file
15
tests/dict/data/unicode1_leader_hidden_followers.py
Normal file
@ -0,0 +1,15 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode", "Common configuration",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [descr1])
|
||||
descr = OptionDescription("unicode1_leader_hidden_followers", "Leader follower with unicode and hidden leader", [descr])
|
||||
return descr
|
62
tests/dict/data/unicode1_leadership.json
Normal file
62
tests/dict/data/unicode1_leadership.json
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"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
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
15
tests/dict/data/unicode1_leadership.py
Normal file
15
tests/dict/data/unicode1_leadership.py
Normal file
@ -0,0 +1,15 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership", "Leader followers with Unicode", [descr])
|
||||
return descr
|
84
tests/dict/data/unicode1_leadership_default_value.json
Normal file
84
tests/dict/data/unicode1_leadership_default_value.json
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "string",
|
||||
"default": "follower2",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 2 with default multi"
|
||||
},
|
||||
"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,
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"owner": "default"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"0": {
|
||||
"value": "follower2",
|
||||
"owner": "default"
|
||||
},
|
||||
"1": {
|
||||
"value": "follower2",
|
||||
"owner": "default"
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"clearable": true,
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"clearable": true,
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
16
tests/dict/data/unicode1_leadership_default_value.py
Normal file
16
tests/dict/data/unicode1_leadership_default_value.py
Normal file
@ -0,0 +1,16 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_default_value", "Leader followers with unicode with default value", [descr])
|
||||
return descr
|
83
tests/dict/data/unicode1_leadership_hidden.json
Normal file
83
tests/dict/data/unicode1_leadership_hidden.json
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 2 hidden"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 3"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true,
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"owner": "user"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"0": {
|
||||
"display": false,
|
||||
"hidden": true,
|
||||
"value": "super",
|
||||
"owner": "user"
|
||||
},
|
||||
"1": {
|
||||
"display": false,
|
||||
"hidden": true
|
||||
},
|
||||
"null": {
|
||||
"display": false,
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
25
tests/dict/data/unicode1_leadership_hidden.py
Normal file
25
tests/dict/data/unicode1_leadership_hidden.py
Normal file
@ -0,0 +1,25 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode", "Common configuration",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_hidden", "Leader followers with second follower hidden", [descr])
|
||||
return descr
|
||||
|
||||
|
||||
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')
|
61
tests/dict/data/unicode1_leadership_hidden_all_default.json
Normal file
61
tests/dict/data/unicode1_leadership_hidden_all_default.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"type": "string",
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode1": {
|
||||
"properties": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 2"
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 3"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode1.unicode1": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
16
tests/dict/data/unicode1_leadership_hidden_all_default.py
Normal file
16
tests/dict/data/unicode1_leadership_hidden_all_default.py
Normal file
@ -0,0 +1,16 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode1", "Common configuration",
|
||||
[option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [option, descr1])
|
||||
descr = OptionDescription("unicode1_leadership_hidden_all_default", "FIXME...", [descr])
|
||||
return descr
|
72
tests/dict/data/unicode1_leadership_not_equal.json
Normal file
72
tests/dict/data/unicode1_leadership_not_equal.json
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 2 not equal"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 3 not equal"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration 1"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration 2"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input",
|
||||
"not_equal": {
|
||||
"options": [
|
||||
"options.unicode.unicode3"
|
||||
]
|
||||
}
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input",
|
||||
"not_equal": {
|
||||
"options": [
|
||||
"options.unicode.unicode2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
17
tests/dict/data/unicode1_leadership_not_equal.py
Normal file
17
tests/dict/data/unicode1_leadership_not_equal.py
Normal file
@ -0,0 +1,17 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
option2.impl_add_consistency('not_equal', option3)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_not_equal", "Leader followers with follower not equal", [descr])
|
||||
return descr
|
76
tests/dict/data/unicode1_leadership_requires.json
Normal file
76
tests/dict/data/unicode1_leadership_requires.json
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Values 'test' must show 'Unicode follower 3'"
|
||||
},
|
||||
"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
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"hide": [
|
||||
"options.unicode.unicode3"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"test": {
|
||||
"show": [
|
||||
"options.unicode.unicode3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
20
tests/dict/data/unicode1_leadership_requires.py
Normal file
20
tests/dict/data/unicode1_leadership_requires.py
Normal file
@ -0,0 +1,20 @@
|
||||
from tiramisu.option import UnicodeOption, 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', "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)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_requires", "Leader followers with Unicode follower 3 hidden when Unicode follower 2 is test", [descr])
|
||||
return descr
|
81
tests/dict/data/unicode1_leadership_requires_all.json
Normal file
81
tests/dict/data/unicode1_leadership_requires_all.json
Normal file
@ -0,0 +1,81 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"type": "string",
|
||||
"title": "Value 'test' must show Leadership"
|
||||
},
|
||||
"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"
|
||||
}
|
19
tests/dict/data/unicode1_leadership_requires_all.py
Normal file
19
tests/dict/data/unicode1_leadership_requires_all.py
Normal file
@ -0,0 +1,19 @@
|
||||
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 Leadership")
|
||||
option1 = UnicodeOption('unicode1', "Unicode leader", multi=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], requires=[{'option': option,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
'inverse': True}])
|
||||
descr = OptionDescription("options", "Common configuration", [option, descr1])
|
||||
descr = OptionDescription("unicode1_leadership_requires_all", "Leader follower with requirement", [descr])
|
||||
return descr
|
68
tests/dict/data/unicode1_leadership_requires_follower.json
Normal file
68
tests/dict/data/unicode1_leadership_requires_follower.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode1": {
|
||||
"properties": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Values 'test' must show 'Unicode follower 2'"
|
||||
},
|
||||
"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.unicode1": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "input",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"hide": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"test": {
|
||||
"show": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
19
tests/dict/data/unicode1_leadership_requires_follower.py
Normal file
19
tests/dict/data/unicode1_leadership_requires_follower.py
Normal file
@ -0,0 +1,19 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
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}])
|
||||
descr1 = Leadership("unicode1", "Common configuration",
|
||||
[option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_requires_follower", "Leader follower requires follower with leader", [descr])
|
||||
return descr
|
@ -0,0 +1,88 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode1": {
|
||||
"properties": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Values 'test' must show 'Unicode follower 2'"
|
||||
},
|
||||
"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.unicode1": {
|
||||
"required": true,
|
||||
"value": [
|
||||
"test",
|
||||
"pas test"
|
||||
],
|
||||
"owner": "user"
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"0": {
|
||||
"value": "super1",
|
||||
"owner": "user"
|
||||
}
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"0": {
|
||||
"value": "super1",
|
||||
"owner": "user"
|
||||
},
|
||||
"1": {
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "input",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"hide": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"test": {
|
||||
"show": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
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}])
|
||||
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])
|
||||
return descr
|
||||
|
||||
|
||||
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')
|
68
tests/dict/data/unicode1_leadership_requires_followers.json
Normal file
68
tests/dict/data/unicode1_leadership_requires_followers.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode1": {
|
||||
"properties": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Values 'test' must show 'Unicode follower 2'"
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 2"
|
||||
}
|
||||
},
|
||||
"type": "array",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"title": "Common configuration"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode1.unicode1": {
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode1.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode1.unicode2": {
|
||||
"type": "input",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"hide": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"test": {
|
||||
"show": [
|
||||
"options.unicode1.unicode3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode1.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
19
tests/dict/data/unicode1_leadership_requires_followers.py
Normal file
19
tests/dict/data/unicode1_leadership_requires_followers.py
Normal file
@ -0,0 +1,19 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
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}])
|
||||
descr1 = Leadership("unicode1", "Common configuration",
|
||||
[option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_requires_followers", "Leader follower requires follower with a follower", [descr])
|
||||
return descr
|
81
tests/dict/data/unicode1_leadership_requires_leader.json
Normal file
81
tests/dict/data/unicode1_leadership_requires_leader.json
Normal file
@ -0,0 +1,81 @@
|
||||
{
|
||||
"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"
|
||||
}
|
19
tests/dict/data/unicode1_leadership_requires_leader.py
Normal file
19
tests/dict/data/unicode1_leadership_requires_leader.py
Normal file
@ -0,0 +1,19 @@
|
||||
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
|
108
tests/dict/data/unicode1_leadership_requires_value.json
Normal file
108
tests/dict/data/unicode1_leadership_requires_value.json
Normal file
@ -0,0 +1,108 @@
|
||||
{
|
||||
"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,
|
||||
"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,
|
||||
"value": "super",
|
||||
"owner": "user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input",
|
||||
"dependencies": {
|
||||
"default": {
|
||||
"hide": [
|
||||
"options.unicode.unicode3"
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"test": {
|
||||
"show": [
|
||||
"options.unicode.unicode3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
33
tests/dict/data/unicode1_leadership_requires_value.py
Normal file
33
tests/dict/data/unicode1_leadership_requires_value.py
Normal file
@ -0,0 +1,33 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu import Leadership
|
||||
|
||||
|
||||
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)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_requires_value", "Leader followers with Unicode follower 3 hidden when Unicode follower 2 is test and modified value", [descr])
|
||||
return descr
|
||||
|
||||
|
||||
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')
|
63
tests/dict/data/unicode1_leadership_submulti.json
Normal file
63
tests/dict/data/unicode1_leadership_submulti.json
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"schema": {
|
||||
"options": {
|
||||
"properties": {
|
||||
"options.unicode": {
|
||||
"properties": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode leader"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"title": "Unicode follower 1"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "string",
|
||||
"isMulti": true,
|
||||
"isSubMulti": true,
|
||||
"title": "Unicode follower 2 submulti"
|
||||
},
|
||||
"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
|
||||
}
|
||||
},
|
||||
"form": {
|
||||
"options.unicode.unicode": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode1": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode2": {
|
||||
"type": "input"
|
||||
},
|
||||
"options.unicode.unicode3": {
|
||||
"type": "input"
|
||||
},
|
||||
"null": [
|
||||
{
|
||||
"title": "Configurer",
|
||||
"type": "submit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": "1.0"
|
||||
}
|
17
tests/dict/data/unicode1_leadership_submulti.py
Normal file
17
tests/dict/data/unicode1_leadership_submulti.py
Normal file
@ -0,0 +1,17 @@
|
||||
from tiramisu.option import UnicodeOption, 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)
|
||||
descr1 = Leadership("unicode", "Common configuration 1",
|
||||
[option, option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration 2", [descr1])
|
||||
descr = OptionDescription("unicode1_leadership_submulti", "Leader followers with submulti Unicode", [descr])
|
||||
return descr
|
||||
|
4
tests/dict/data/unicode1_leadership_value.dict
Normal file
4
tests/dict/data/unicode1_leadership_value.dict
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val3", "val4"],
|
||||
"options.unicode.unicode1": ["super1", "super2"],
|
||||
"options.unicode.unicode2": ["pas test", "test"],
|
||||
"options.unicode.unicode3": [null, "super"]}
|
4
tests/dict/data/unicode1_leadership_value.dict1
Normal file
4
tests/dict/data/unicode1_leadership_value.dict1
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val1", "val2"],
|
||||
"options.unicode.unicode1": [null, null],
|
||||
"options.unicode.unicode2": ["follower2", "follower2"],
|
||||
"options.unicode.unicode3": [null, null]}
|
4
tests/dict/data/unicode1_leadership_value.dict2
Normal file
4
tests/dict/data/unicode1_leadership_value.dict2
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val3"],
|
||||
"options.unicode.unicode1": ["super1"],
|
||||
"options.unicode.unicode2": ["pas test"],
|
||||
"options.unicode.unicode3": [null]}
|
4
tests/dict/data/unicode1_leadership_value.dict3
Normal file
4
tests/dict/data/unicode1_leadership_value.dict3
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val3", "val4", "val5"],
|
||||
"options.unicode.unicode1": ["super1", "super2", null],
|
||||
"options.unicode.unicode2": ["pas test", "test", "follower2"],
|
||||
"options.unicode.unicode3": [null, "super", null]}
|
4
tests/dict/data/unicode1_leadership_value.dict4
Normal file
4
tests/dict/data/unicode1_leadership_value.dict4
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val3", "val4", "val5"],
|
||||
"options.unicode.unicode1": ["super1", "super2", null],
|
||||
"options.unicode.unicode2": ["pas test", "test", "follower2"],
|
||||
"options.unicode.unicode3": [null, "super", null]}
|
4
tests/dict/data/unicode1_leadership_value.dict5
Normal file
4
tests/dict/data/unicode1_leadership_value.dict5
Normal file
@ -0,0 +1,4 @@
|
||||
{"options.unicode.unicode": ["val3", "val4"],
|
||||
"options.unicode.unicode1": ["super1", "super2"],
|
||||
"options.unicode.unicode2": ["pas test", "follower2"],
|
||||
"options.unicode.unicode3": [null, "super"]}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user