diff --git a/test/test_option_consistency.py b/test/test_option_consistency.py index b40c340..45e8213 100644 --- a/test/test_option_consistency.py +++ b/test/test_option_consistency.py @@ -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