diff --git a/tests/test_option_setting.py b/tests/test_option_setting.py index 12037db..1cdf17b 100644 --- a/tests/test_option_setting.py +++ b/tests/test_option_setting.py @@ -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'}]} diff --git a/tiramisu/config.py b/tiramisu/config.py index 16bc7fa..1e631b1 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -599,6 +599,7 @@ class _CommonConfig(_SubConfig): option_bag = OptionBag(option, None, config_bag, + properties=None, ) self.reset_cache(option_bag)