Compare commits
No commits in common. "36ab09265a57aa03988129f5790d3ac61965f80e" and "a18e0893878acae0d87d844c2eb0b79a2ce7d736" have entirely different histories.
36ab09265a
...
a18e089387
4 changed files with 4 additions and 31 deletions
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "tiramisu"
|
||||
version = "5.2.0a34"
|
||||
version = "5.2.0a33"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "an options controller tool"
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ def test_mod_read_only_write():
|
|||
|
||||
|
||||
def test_setting_tree(config_type):
|
||||
s = StrOption("string", "", default=["string", "sdfsdf"], default_multi="value", multi=True)
|
||||
s = StrOption("string", "", default=["string", "sdfsdf"], default_multi="prout", multi=True)
|
||||
od4 = OptionDescription("option4", "", [s])
|
||||
od3 = OptionDescription("option3", "", [od4])
|
||||
od2 = OptionDescription("option2", "", [od3], properties=('hidden',))
|
||||
|
|
@ -151,23 +151,8 @@ def test_setting_tree(config_type):
|
|||
cfg.option('option2.option3.option4.string').value.get()
|
||||
|
||||
|
||||
def test_setting_tree_2(config_type):
|
||||
s = StrOption("string", "", default=["string", "sdfsdf"], default_multi="value", multi=True)
|
||||
od4 = OptionDescription("option4", "", [s])
|
||||
od3 = OptionDescription("option3", "", [od4])
|
||||
od2 = OptionDescription("option2", "", [od3], properties=('hidden',))
|
||||
od1 = OptionDescription("root", "", [od2])
|
||||
cfg = Config(od1)
|
||||
cfg = get_config(cfg, config_type)
|
||||
cfg.property.read_write()
|
||||
option = cfg.option('option2.option3.option4.string')
|
||||
option.isoptiondescription()
|
||||
with pytest.raises(PropertiesOptionError):
|
||||
option.value.get()
|
||||
|
||||
|
||||
def test_setitem(config_type):
|
||||
s = StrOption("string", "", default=["string", "sdfsdf"], default_multi="value", multi=True)
|
||||
s = StrOption("string", "", default=["string", "sdfsdf"], default_multi="prout", multi=True)
|
||||
od1 = OptionDescription("options", "", [s])
|
||||
cfg = Config(od1)
|
||||
cfg = get_config(cfg, config_type)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "5.2.0a34"
|
||||
__version__ = "5.2.0a33"
|
||||
|
|
|
|||
|
|
@ -127,18 +127,6 @@ class CommonTiramisu(TiramisuHelp):
|
|||
|
||||
def _set_subconfig(self) -> None:
|
||||
if self._subconfig:
|
||||
if self._validate_properties:
|
||||
# FIXME: to force the properties validation, should be done only one time
|
||||
try:
|
||||
self._config_bag.context.get_sub_config(
|
||||
self._config_bag,
|
||||
self._path,
|
||||
self._index,
|
||||
validate_properties=self._validate_properties,
|
||||
allow_dynoption=True,
|
||||
)
|
||||
except AssertionError as err:
|
||||
raise ConfigError(str(err))
|
||||
if id(self._subconfig.config_bag) != id(self._config_bag):
|
||||
subconfig = self._subconfig
|
||||
self._subconfig = subconfig.__class__(option=subconfig.option,
|
||||
|
|
|
|||
Loading…
Reference in a new issue