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:
@ -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')
|
||||
|
Reference in New Issue
Block a user