add test for consistency with callback
This commit is contained in:
parent
544cd93c73
commit
5f46763696
@ -345,3 +345,17 @@ def test_consistency_permissive():
|
||||
c.cfgimpl_get_settings().setpermissive(('hidden',))
|
||||
c.read_write()
|
||||
c.a = 1
|
||||
|
||||
|
||||
def return_val(*args, **kwargs):
|
||||
return '192.168.1.1'
|
||||
|
||||
|
||||
def test_consistency_with_callback():
|
||||
a = NetworkOption('a', '', default='192.168.1.0')
|
||||
b = NetmaskOption('b', '', default='255.255.255.0')
|
||||
c = IPOption('c', '', callback=return_val, callback_params={'': ((a, False),)})
|
||||
od = OptionDescription('od', '', [a, b, c])
|
||||
c.impl_add_consistency('in_network', a, b)
|
||||
cfg = Config(od)
|
||||
cfg.c
|
||||
|
Loading…
Reference in New Issue
Block a user