validate value when we calculate it
This commit is contained in:
@ -345,6 +345,17 @@ def test_callback_list():
|
||||
raises(ValueError, "cfg.val1")
|
||||
|
||||
|
||||
def test_callback_list2():
|
||||
val1 = StrOption('val1', "", callback=return_list)
|
||||
val2 = StrOption('val2', "", callback=return_value, callback_params={'': ((val1, False),)})
|
||||
maconfig = OptionDescription('rootconfig', '', [val1, val2])
|
||||
cfg = Config(maconfig)
|
||||
cfg.read_write()
|
||||
raises(ValueError, "cfg.val1")
|
||||
#cfg.val2
|
||||
raises(ValueError, "cfg.val2")
|
||||
|
||||
|
||||
def test_callback_multi():
|
||||
val1 = StrOption('val1', "", callback=return_val, multi=True)
|
||||
maconfig = OptionDescription('rootconfig', '', [val1])
|
||||
|
Reference in New Issue
Block a user