ValueError if not PropertieError

This commit is contained in:
2015-04-18 23:46:37 +02:00
parent d959020eed
commit 057bba83e4
3 changed files with 25 additions and 4 deletions

View File

@ -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),)})