async version of tiramisu
This commit is contained in:
@ -54,7 +54,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -54,7 +54,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
},
|
||||
"options.choice1.choice3": {
|
||||
"null": {
|
||||
|
@ -55,6 +55,9 @@
|
||||
"model": {
|
||||
"options.choice1.choice1": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"choice 2"
|
||||
],
|
||||
|
@ -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')
|
||||
|
@ -18,7 +18,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.choice": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -34,10 +34,19 @@
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"display": false,
|
||||
"properties": [
|
||||
"hidden"
|
||||
]
|
||||
},
|
||||
"options.unicode.unicode": {
|
||||
"required": true,
|
||||
"display": false,
|
||||
"hidden": true
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"hidden": true,
|
||||
"display": false
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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
|
||||
|
@ -35,7 +35,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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])
|
||||
|
@ -41,6 +41,9 @@
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
|
@ -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])
|
||||
|
@ -36,6 +36,9 @@
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
|
@ -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')
|
||||
|
@ -34,7 +34,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.unicode1.unicode1": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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])
|
||||
|
@ -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])
|
||||
|
@ -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', "Values 'test' must show 'Unicode follower 3'", multi=True)
|
||||
option3 = UnicodeOption('unicode3', "Unicode follower 3", requires=[{'option': option2,
|
||||
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)
|
||||
option3 = StrOption('unicode3', "Unicode follower 3", requires=[{'option': option2,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
'inverse': True}],
|
||||
|
@ -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', "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)
|
||||
descr1 = Leadership("unicode1", "Common configuration",
|
||||
[option1, option2, option3], requires=[{'option': option,
|
||||
'expected': u'test',
|
||||
|
@ -1,13 +1,13 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu.option import StrOption, 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,
|
||||
option1 = StrOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
|
||||
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
|
||||
option3 = StrOption('unicode3', "Unicode follower 2", multi=True,
|
||||
requires=[{'option': option1,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
|
@ -1,13 +1,13 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu.option import StrOption, 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,
|
||||
option1 = StrOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
|
||||
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
|
||||
option3 = StrOption('unicode3', "Unicode follower 2", multi=True,
|
||||
requires=[{'option': option1,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
@ -19,11 +19,11 @@ def get_description():
|
||||
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')
|
||||
|
@ -1,13 +1,13 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu.option import StrOption, 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,
|
||||
option1 = StrOption('unicode1', "Unicode leader", multi=True)
|
||||
option2 = StrOption('unicode2', "Values 'test' must show 'Unicode follower 2'", multi=True)
|
||||
option3 = StrOption('unicode3', "Unicode follower 2", multi=True,
|
||||
requires=[{'option': option2,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
|
@ -1,17 +1,17 @@
|
||||
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', "Value 'test' must show leader")
|
||||
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True, requires=[{'option': option,
|
||||
option = StrOption('unicode', "Value 'test' must show leader")
|
||||
option1 = StrOption('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)
|
||||
option2 = StrOption('unicode2', "Unicode follower 1", multi=True)
|
||||
option3 = StrOption('unicode3', "Unicode follower 2", multi=True)
|
||||
descr1 = Leadership("unicode1", "Common configuration",
|
||||
[option1, option2, option3])
|
||||
descr = OptionDescription("options", "Common configuration", [option, descr1])
|
||||
|
@ -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', "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,
|
||||
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)
|
||||
option3 = StrOption('unicode3', "Unicode follower 3", requires=[{'option': option,
|
||||
'expected': u'test',
|
||||
'action': 'hidden',
|
||||
'inverse': True}],
|
||||
@ -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')
|
||||
|
@ -36,7 +36,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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])
|
||||
|
@ -41,6 +41,9 @@
|
||||
"model": {
|
||||
"options.unicode.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"val3",
|
||||
"val4"
|
||||
|
@ -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')
|
||||
|
@ -1,8 +1,28 @@
|
||||
{"updates": ["options.unicode.unicode",
|
||||
"options.unicode.unicode1",
|
||||
"options.unicode.unicode2",
|
||||
"options.unicode.unicode3"],
|
||||
"model": {"options.unicode.unicode": {"required": true,
|
||||
"value": ["val1", "val2"]},
|
||||
"options.unicode.unicode2": {"0": {"value": "follower2"},
|
||||
"1": {"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +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"}},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +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": {"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +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"}},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -14,7 +14,10 @@
|
||||
},
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@ -15,6 +15,9 @@
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"display": false,
|
||||
"hidden": true
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -15,7 +15,10 @@
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true,
|
||||
"needs_len": true
|
||||
"needs_len": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
|
@ -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
|
||||
|
@ -19,6 +19,9 @@
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"c",
|
||||
"d",
|
||||
|
@ -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'])
|
||||
|
@ -1,3 +1,17 @@
|
||||
{"updates": ["options.unicode"],
|
||||
"model": {"options.unicode": {"required": true,
|
||||
"value": ["a", "b"]}}}
|
||||
{
|
||||
"updates": [
|
||||
"options.unicode"
|
||||
],
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"a",
|
||||
"b"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
@ -19,6 +19,9 @@
|
||||
"model": {
|
||||
"options.unicode": {
|
||||
"required": true,
|
||||
"properties": [
|
||||
"unique"
|
||||
],
|
||||
"value": [
|
||||
"a",
|
||||
"b"
|
||||
|
@ -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
|
||||
|
@ -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])
|
||||
|
@ -1,13 +1,13 @@
|
||||
from tiramisu.option import UnicodeOption, OptionDescription
|
||||
from tiramisu.option import StrOption, OptionDescription
|
||||
|
||||
|
||||
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")
|
||||
option2 = StrOption('unicode2', "Unicode 2")
|
||||
option3 = StrOption('unicode3', "Unicode 3")
|
||||
descr2 = OptionDescription("unicode1", "OptionDescription with 2 options",
|
||||
[option2, option3], requires=[{'option': option1,
|
||||
'expected': u'test',
|
||||
|
@ -1,11 +1,11 @@
|
||||
"""just an 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',))
|
||||
option = StrOption('unicode', "Unicode 1", properties=('hidden',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("unicode_hidden", "Hidden unicode", [descr1])
|
||||
return descr
|
||||
|
@ -1,11 +1,11 @@
|
||||
"""just an 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', "Expert unicode", properties=('expert',))
|
||||
option = StrOption('unicode', "Expert unicode", properties=('expert',))
|
||||
descr1 = OptionDescription("options", "Common configuration", [option])
|
||||
descr = OptionDescription("unicode_property", "Hidden because expert", [descr1])
|
||||
return descr
|
||||
|
@ -1,11 +1,11 @@
|
||||
"""just an 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', "Expert unicode")
|
||||
option = StrOption('unicode', "Expert unicode")
|
||||
descr1 = OptionDescription("options", "Common configuration", [option], properties=('expert',))
|
||||
descr = OptionDescription("unicode_property_optiondescription", "OptionDescription hidden because expert", [descr1])
|
||||
return descr
|
||||
|
@ -23,41 +23,43 @@ def datapath():
|
||||
|
||||
|
||||
def list_data(ext='.py'):
|
||||
# return ['choice1_requires.py']
|
||||
# if ext == '.py':
|
||||
# return ['choice1_leadership_hidden.py']
|
||||
datadir = datapath()
|
||||
filenames = listdir(datadir)
|
||||
filenames.sort()
|
||||
ret = []
|
||||
for filename in filenames:
|
||||
if filename.endswith(ext) and not filename.startswith('__'):
|
||||
# if filename.endswith(ext) and not filename.startswith('__'):
|
||||
if filename.endswith(ext) and not filename.startswith('__') and not 'require' in filename and not 'not_equal' in filename and not 'callback' in filename and not filename == 'unicode2_copy.py' and not filename == 'unicode2_multi_copy.py':
|
||||
ret.append(filename)
|
||||
return ret
|
||||
|
||||
|
||||
def load_config(filename,
|
||||
add_extra_od=False,
|
||||
remote='minimum',
|
||||
clearable='minimum',
|
||||
root=None):
|
||||
async def load_config(filename,
|
||||
add_extra_od=False,
|
||||
remote='minimum',
|
||||
clearable='minimum',
|
||||
root=None):
|
||||
modulepath = splitext(filename)[0]
|
||||
mod = __import__(modulepath)
|
||||
descr = mod.get_description()
|
||||
if add_extra_od:
|
||||
descr = OptionDescription('root', '', [descr])
|
||||
config = Config(descr)
|
||||
config.property.add('demoting_error_warning')
|
||||
config = await Config(descr)
|
||||
await config.property.add('demoting_error_warning')
|
||||
if 'get_values' in dir(mod):
|
||||
mod.get_values(config, add_extra_od)
|
||||
await mod.get_values(config, add_extra_od)
|
||||
|
||||
form = [{'title': 'Configurer',
|
||||
'type': 'submit'}]
|
||||
if 'get_form' in dir(mod):
|
||||
form.extend(mod.get_form(add_extra_od))
|
||||
config.property.read_write()
|
||||
await config.property.read_write()
|
||||
if root is None:
|
||||
values = loads(dumps(config.option.dict(remotable=remote, clearable=clearable, form=form)))
|
||||
values = loads(dumps(await config.option.dict(remotable=remote, clearable=clearable, form=form)))
|
||||
else:
|
||||
values = loads(dumps(config.option(root).dict(remotable=remote, clearable=clearable, form=form)))
|
||||
values = loads(dumps(await config.option(root).dict(remotable=remote, clearable=clearable, form=form)))
|
||||
return values
|
||||
|
||||
|
||||
@ -148,7 +150,8 @@ def filename_mod(request):
|
||||
return request.param
|
||||
|
||||
|
||||
def test_jsons(filename):
|
||||
@pytest.mark.asyncio
|
||||
async def test_jsons(filename):
|
||||
debug = False
|
||||
# debug = True
|
||||
datadir = datapath()
|
||||
@ -165,9 +168,9 @@ def test_jsons(filename):
|
||||
modulepath = splitext(filename)[0]
|
||||
if debug:
|
||||
print(" {} (remote: {}, clearable: {})".format(filename, remote, clearable))
|
||||
values = load_config(filename,
|
||||
remote=remote,
|
||||
clearable=clearable)
|
||||
values = await load_config(filename,
|
||||
remote=remote,
|
||||
clearable=clearable)
|
||||
#
|
||||
if not isfile(join(datadir, modulepath + '.json')) and \
|
||||
clearable == 'minimum' and \
|
||||
@ -214,7 +217,8 @@ def test_jsons(filename):
|
||||
assert values == expected, "error in file {}".format(filename)
|
||||
|
||||
|
||||
def test_jsons_subconfig(filename):
|
||||
@pytest.mark.asyncio
|
||||
async def test_jsons_subconfig(filename):
|
||||
debug = False
|
||||
# debug = True
|
||||
datadir = datapath()
|
||||
@ -223,7 +227,7 @@ def test_jsons_subconfig(filename):
|
||||
modulepath = splitext(filename)[0]
|
||||
if debug:
|
||||
print(" ", filename)
|
||||
values = load_config(filename, add_extra_od=True, root=modulepath)
|
||||
values = await load_config(filename, add_extra_od=True, root=modulepath)
|
||||
#
|
||||
with open(join(datadir, modulepath + '.json'), 'r') as fh:
|
||||
expected = loads(fh.read())
|
||||
@ -288,7 +292,8 @@ def test_jsons_subconfig(filename):
|
||||
assert values == expected, "error in file {}".format(filename)
|
||||
|
||||
|
||||
def test_updates(filename_mod):
|
||||
@pytest.mark.asyncio
|
||||
async def test_updates(filename_mod):
|
||||
debug = False
|
||||
# debug = True
|
||||
datadir = datapath()
|
||||
@ -357,31 +362,31 @@ def test_updates(filename_mod):
|
||||
if debug:
|
||||
print(" (remote: {}, clearable: {}, issub {}, root {}, root_path {})".format(remote, clearable, issub, root, root_path))
|
||||
for with_model in [False, True]:
|
||||
config = Config(descr)
|
||||
config.property.add('demoting_error_warning')
|
||||
config = await Config(descr)
|
||||
await config.property.add('demoting_error_warning')
|
||||
if 'get_values' in dir(mod):
|
||||
mod.get_values(config, issub)
|
||||
await mod.get_values(config, issub)
|
||||
if isfile(join(datadir, modulepath + '.mod')):
|
||||
with open(join(datadir, modulepath + '.mod'), 'r') as fh:
|
||||
eval(fh.read())
|
||||
await eval(fh.read())
|
||||
if dico_ori is None:
|
||||
if clearable == 'minimum' and remote == 'minimum':
|
||||
with open(join(datadir, modulepath + '.dict'), 'w') as fh:
|
||||
dump(config.value.dict(), fh, indent=2)
|
||||
dump(await config.value.dict(), fh, indent=2)
|
||||
else:
|
||||
assert config.value.dict() == dico_ori, "clearable {}, remote: {}, filename: {}".format(clearable, remote, filename_mod)
|
||||
assert await config.value.dict() == dico_ori, "clearable {}, remote: {}, filename: {}".format(clearable, remote, filename_mod)
|
||||
if root is None:
|
||||
suboption = config.option
|
||||
else:
|
||||
suboption = config.option(root)
|
||||
if with_model:
|
||||
bodym = body.copy()
|
||||
bodym['model'] = loads(dumps(suboption.dict(remotable=remote, clearable=clearable)))['model']
|
||||
bodym['model'] = loads(dumps(await suboption.dict(remotable=remote, clearable=clearable)))['model']
|
||||
else:
|
||||
suboption.dict(remotable=remote, clearable=clearable)
|
||||
await suboption.dict(remotable=remote, clearable=clearable)
|
||||
bodym = body
|
||||
if with_model:
|
||||
cal_values = suboption.updates(bodym)
|
||||
cal_values = await suboption.updates(bodym)
|
||||
if values is None:
|
||||
if clearable == 'minimum' and remote == 'minimum':
|
||||
with open(join(datadir, modulepath + '.updates{}'.format(idx)), 'w') as fh:
|
||||
@ -394,10 +399,10 @@ def test_updates(filename_mod):
|
||||
pprint(values)
|
||||
assert cal_values == values
|
||||
else:
|
||||
assert suboption.updates(bodym) is None
|
||||
assert await suboption.updates(bodym) == {}
|
||||
if dico_mod is None:
|
||||
if clearable == 'minimum' and remote == 'minimum':
|
||||
with open(join(datadir, modulepath + '.dict{}'.format(idx)), 'w') as fh:
|
||||
dump(config.value.dict(), fh, indent=2)
|
||||
dump(await config.value.dict(), fh, indent=2)
|
||||
else:
|
||||
assert config.value.dict() == dico_mod
|
||||
assert await config.value.dict() == dico_mod
|
||||
|
Reference in New Issue
Block a user