do not valid properties when remove cache for information
This commit is contained in:
parent
460039386a
commit
3e6b90bd9c
2 changed files with 17 additions and 1 deletions
|
@ -11,7 +11,7 @@ from tiramisu.setting import owners, groups
|
|||
from tiramisu import ChoiceOption, BoolOption, IntOption, FloatOption, \
|
||||
StrOption, OptionDescription, Leadership, Config, undefined, \
|
||||
Calculation, Params, ParamOption, ParamValue, ParamIndex, \
|
||||
calc_value, calc_value_property_help
|
||||
calc_value, calc_value_property_help, ParamInformation
|
||||
from tiramisu.error import PropertiesOptionError
|
||||
import warnings
|
||||
from .config import config_type, get_config
|
||||
|
@ -894,3 +894,18 @@ def test_settings_list_with_follower():
|
|||
cfg = Config(OptionDescription('root', 'root', [descr]))
|
||||
cfg.property.read_write()
|
||||
assert len(cfg.option('root').list('all')) == 2
|
||||
|
||||
|
||||
def return_none(*args):
|
||||
return
|
||||
|
||||
|
||||
def test_settings_disable_set_information(config_type):
|
||||
opt1 = StrOption('opt1', '', ['val'], multi=True)
|
||||
opt2 = StrOption('opt2', '', default_multi='test', validators=[Calculation(return_none, Params((ParamInformation('key'))))], properties=frozenset([Calculation(return_none, Params((ParamInformation('key'))))]), multi=True)
|
||||
od2 = Leadership('leadership', '', [opt1, opt2])
|
||||
od1 = OptionDescription('root', '', [od2])
|
||||
cfg = Config(od1)
|
||||
cfg.property.read_only()
|
||||
cfg.information.set('key', 'val')
|
||||
assert cfg.value.dict() == {'leadership.opt1': [{'leadership.opt1': 'val', 'leadership.opt2': 'test'}]}
|
||||
|
|
|
@ -599,6 +599,7 @@ class _CommonConfig(_SubConfig):
|
|||
option_bag = OptionBag(option,
|
||||
None,
|
||||
config_bag,
|
||||
properties=None,
|
||||
)
|
||||
self.reset_cache(option_bag)
|
||||
|
||||
|
|
Loading…
Reference in a new issue