add test for callback not in multi
This commit is contained in:
parent
b2538f6f0b
commit
ada5bfbf6c
|
@ -276,6 +276,18 @@ def test_freeze_and_has_callback():
|
|||
raises(PropertiesOptionError, "config.gc.dummy = True")
|
||||
|
||||
|
||||
def test_callback():
|
||||
val1 = StrOption('val1', "", callback=return_value)
|
||||
maconfig = OptionDescription('rootconfig', '', [val1])
|
||||
cfg = Config(maconfig)
|
||||
cfg.read_write()
|
||||
assert cfg.val1 == 'val'
|
||||
cfg.val1 = 'new-val'
|
||||
assert cfg.val1 == 'new-val'
|
||||
del(cfg.val1)
|
||||
assert cfg.val1 == 'val'
|
||||
|
||||
|
||||
def test_callback_master_and_slaves():
|
||||
val1 = StrOption('val1', "", multi=True)
|
||||
val2 = StrOption('val2', "", multi=True, callback=return_value)
|
||||
|
|
Loading…
Reference in New Issue