add test for consistency with callback

This commit is contained in:
Emmanuel Garette 2014-03-12 16:44:48 +01:00
parent 544cd93c73
commit 5f46763696

View file

@ -345,3 +345,17 @@ def test_consistency_permissive():
c.cfgimpl_get_settings().setpermissive(('hidden',)) c.cfgimpl_get_settings().setpermissive(('hidden',))
c.read_write() c.read_write()
c.a = 1 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