ValueError if not PropertieError
This commit is contained in:
@ -843,6 +843,20 @@ def test_callback_two_disabled2():
|
||||
assert cfg.getowner(opt2, force_permissive=True) == owners.default
|
||||
|
||||
|
||||
def test_callback_calculating_invalid():
|
||||
opt1 = IntOption('opt1', '', 1)
|
||||
opt2 = BoolOption('opt2', '', callback=return_value, callback_params={'': ((opt1, False),)})
|
||||
od1 = OptionDescription('od1', '', [opt1])
|
||||
od2 = OptionDescription('od2', '', [opt2])
|
||||
maconfig = OptionDescription('rootconfig', '', [od1, od2])
|
||||
cfg = Config(maconfig)
|
||||
setting = cfg.cfgimpl_get_settings()
|
||||
cfg.read_write()
|
||||
raises(ValueError, 'cfg.od2.opt2')
|
||||
setting[opt2].append('disabled')
|
||||
raises(PropertiesOptionError, 'cfg.od2.opt2')
|
||||
|
||||
|
||||
def test_callback_calculating_disabled():
|
||||
opt1 = BoolOption('opt1', '', properties=('disabled',))
|
||||
opt2 = BoolOption('opt2', '', callback=return_value, callback_params={'': ((opt1, False),)})
|
||||
|
Reference in New Issue
Block a user