when we get an option's value, we need it's values to calculate properties (ie for mandatory's option)

if a disabled option has a callback to an other disabled value, it's raise ConfigError

now only raise if option has no other propertiesError
This commit is contained in:
2013-09-16 15:02:14 +02:00
parent 327cce6fed
commit 9ddf100118
2 changed files with 23 additions and 5 deletions

View File

@ -498,3 +498,14 @@ def test_callback_hidden():
cfg.read_write()
raises(PropertiesOptionError, 'cfg.od1.opt1')
cfg.od2.opt2
def test_callback_disable_make_dict():
opt1 = BoolOption('opt1', '', properties=('disabled',))
opt2 = BoolOption('opt2', '', callback=return_value, callback_params={'': (('od1.opt1', False),)}, properties=('disabled',))
od1 = OptionDescription('od1', '', [opt1])
od2 = OptionDescription('od2', '', [opt2])
maconfig = OptionDescription('rootconfig', '', [od1, od2])
cfg = Config(maconfig)
cfg.read_write()
raises(PropertiesOptionError, 'cfg.od1.opt1')