update tests ans version number

This commit is contained in:
Emmanuel Garette 2019-07-26 10:13:45 +02:00
parent fd18af62ca
commit 613ae47573
18 changed files with 28 additions and 43 deletions

View File

@ -23,8 +23,7 @@
"model": { "model": {
"options.choice": { "options.choice": {
"required": true, "required": true,
"value": "hide", "value": "hide"
"owner": "default"
}, },
"options.unicode2": { "options.unicode2": {
"display": false, "display": false,

View File

@ -14,8 +14,7 @@
}, },
"model": { "model": {
"options.integer": { "options.integer": {
"value": 0, "value": 0
"owner": "default"
} }
}, },
"global": { "global": {

View File

@ -6,11 +6,11 @@
"properties": { "properties": {
"options.unicode.unicode": { "options.unicode.unicode": {
"type": "string", "type": "string",
"isMulti": true,
"value": [ "value": [
"val1", "val1",
"val2" "val2"
], ],
"isMulti": true,
"title": "Unicode leader" "title": "Unicode leader"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
@ -44,17 +44,14 @@
"value": [ "value": [
"val1", "val1",
"val2" "val2"
], ]
"owner": "default"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"0": { "0": {
"value": "follower2", "value": "follower2"
"owner": "default"
}, },
"1": { "1": {
"value": "follower2", "value": "follower2"
"owner": "default"
} }
} }
}, },

View File

@ -6,11 +6,11 @@
"properties": { "properties": {
"options.unicode.unicode": { "options.unicode.unicode": {
"type": "string", "type": "string",
"isMulti": true,
"value": [ "value": [
"val1", "val1",
"val2" "val2"
], ],
"isMulti": true,
"title": "Unicode leader" "title": "Unicode leader"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {

View File

@ -2,10 +2,7 @@
"options.unicode.unicode1", "options.unicode.unicode1",
"options.unicode.unicode2", "options.unicode.unicode2",
"options.unicode.unicode3"], "options.unicode.unicode3"],
"model": {"options.unicode.unicode": {"owner": "default", "model": {"options.unicode.unicode": {"required": true,
"required": true,
"value": ["val1", "val2"]}, "value": ["val1", "val2"]},
"options.unicode.unicode2": {"0": {"owner": "default", "options.unicode.unicode2": {"0": {"value": "follower2"},
"value": "follower2"}, "1": {"value": "follower2"}}}}
"1": {"owner": "default",
"value": "follower2"}}}}

View File

@ -11,7 +11,6 @@
"owner": "user"}, "owner": "user"},
"1": {"value": "test", "1": {"value": "test",
"owner": "user"}, "owner": "user"},
"2": {"value": "follower2", "2": {"value": "follower2"}},
"owner": "default"}},
"options.unicode.unicode3": {"1": {"value": "super", "options.unicode.unicode3": {"1": {"value": "super",
"owner": "user"}}}} "owner": "user"}}}}

View File

@ -9,8 +9,7 @@
"value": "pas test"}, "value": "pas test"},
"1": {"owner": "user", "1": {"owner": "user",
"value": "test"}, "value": "test"},
"2": {"owner": "default", "2": {"value": "follower2"}},
"value": "follower2"}},
"options.unicode.unicode3": {"1": {"owner": "user", "options.unicode.unicode3": {"1": {"owner": "user",
"value": "super"}}}, "value": "super"}}},
"updates": ["options.unicode.unicode", "options.unicode.unicode2"]} "updates": ["options.unicode.unicode", "options.unicode.unicode2"]}

View File

@ -8,7 +8,6 @@
"owner": "user"}}, "owner": "user"}},
"options.unicode.unicode2": {"0": {"value": "pas test", "options.unicode.unicode2": {"0": {"value": "pas test",
"owner": "user"}, "owner": "user"},
"1": {"value": "follower2", "1": {"value": "follower2"}},
"owner": "default"}},
"options.unicode.unicode3": {"1": {"value": "super", "options.unicode.unicode3": {"1": {"value": "super",
"owner": "user"}}}} "owner": "user"}}}}

View File

@ -4,11 +4,11 @@
"properties": { "properties": {
"options.unicode": { "options.unicode": {
"type": "string", "type": "string",
"isMulti": true,
"value": [ "value": [
"a", "a",
"b" "b"
], ],
"isMulti": true,
"title": "String 1" "title": "String 1"
} }
}, },

View File

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

View File

@ -24,11 +24,11 @@
}, },
"descr2.unicode2_multi": { "descr2.unicode2_multi": {
"type": "string", "type": "string",
"isMulti": true,
"value": [ "value": [
"a", "a",
"b" "b"
], ],
"isMulti": true,
"title": "Multi unicode 2" "title": "Multi unicode 2"
} }
}, },
@ -56,16 +56,14 @@
"required": true "required": true
}, },
"descr2.unicode2": { "descr2.unicode2": {
"value": "a", "value": "a"
"owner": "default"
}, },
"descr2.unicode2_multi": { "descr2.unicode2_multi": {
"required": true, "required": true,
"value": [ "value": [
"a", "a",
"b" "b"
], ]
"owner": "default"
}, },
"descr3.unicode3_multi": { "descr3.unicode3_multi": {
"required": true "required": true

View File

@ -4,11 +4,11 @@
"properties": { "properties": {
"options.unicode": { "options.unicode": {
"type": "string", "type": "string",
"isMulti": true,
"value": [ "value": [
"a", "a",
"b" "b"
], ],
"isMulti": true,
"title": "String 1" "title": "String 1"
} }
}, },
@ -22,8 +22,7 @@
"value": [ "value": [
"a", "a",
"b" "b"
], ]
"owner": "default"
} }
}, },
"global": { "global": {

View File

@ -14,8 +14,7 @@
}, },
"model": { "model": {
"options.unicode1": { "options.unicode1": {
"value": "word", "value": "word"
"owner": "default"
} }
}, },
"global": { "global": {

View File

@ -18,8 +18,7 @@
}, },
"model": { "model": {
"options.unicode1": { "options.unicode1": {
"value": "test", "value": "test"
"owner": "default"
} }
}, },
"global": { "global": {

View File

@ -101,6 +101,7 @@ def test_owner_is_not_a_string(config_type):
assert cfg.option('dummy').value.get() is False assert cfg.option('dummy').value.get() is False
assert cfg.option('dummy').owner.get() == owners.default assert cfg.option('dummy').owner.get() == owners.default
assert cfg.option('dummy').owner.get() == 'default' assert cfg.option('dummy').owner.get() == 'default'
if config_type == 'tiramisu':
assert isinstance(cfg.option('dummy').owner.get(), owners.Owner) assert isinstance(cfg.option('dummy').owner.get(), owners.Owner)
cfg.option('dummy').value.set(True) cfg.option('dummy').value.set(True)
assert cfg.option('dummy').owner.get() == 'user' assert cfg.option('dummy').owner.get() == 'user'

View File

@ -1,4 +1,4 @@
1rom .autopath import do_autopath from .autopath import do_autopath
do_autopath() do_autopath()
from .config import config_type, get_config from .config import config_type, get_config

View File

@ -45,4 +45,4 @@ allfuncs.extend(all_options)
del(all_options) del(all_options)
__all__ = tuple(allfuncs) __all__ = tuple(allfuncs)
del(allfuncs) del(allfuncs)
__version__ = "3.0rc8" __version__ = "3.0rc9"

View File

@ -742,6 +742,7 @@ class TiramisuDict:
value = childapi.value.get() value = childapi.value.get()
if value is not None and value != []: if value is not None and value != []:
obj['value'] = value obj['value'] = value
if not childapi.owner.isdefault():
obj['owner'] = childapi.owner.get() obj['owner'] = childapi.owner.get()
def _get_value_with_exception(self, def _get_value_with_exception(self,