diff --git a/ChangeLog b/ChangeLog index 65824bc..7614f2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Mon Dec 1 22:58:13 2014 +0200 Emmanuel Garette * propertyerror are transitive in consistency, now it's possible to set non-transitive consistency + * if consistency with multiple option return if transitive Sun Oct 26 08:50:38 2014 +0200 Emmanuel Garette * if option is frozen with force_default_on_freeze property, owner diff --git a/test/test_option_consistency.py b/test/test_option_consistency.py index cca1909..ba3549c 100644 --- a/test/test_option_consistency.py +++ b/test/test_option_consistency.py @@ -419,6 +419,25 @@ def test_consistency_disabled_transitive(): c.a = 1 +def test_consistency_disabled_transitive_2(): + a = IPOption('a', '') + b = IPOption('b', '') + c = NetworkOption('c', '', default='192.168.1.0') + d = NetmaskOption('d', '', default='255.255.255.0', properties=('disabled',)) + od = OptionDescription('od', '', [a, b, c, d]) + a.impl_add_consistency('not_equal', b) + a.impl_add_consistency('in_network', c, d, transitive=False) + c = Config(od) + c.read_write() + c.a = '192.168.1.1' + raises(ValueError, "c.b = '192.168.1.1'") + c.a = '192.168.2.1' + # + c.a = '192.168.1.1' + c.cfgimpl_get_settings().remove('disabled') + raises(ValueError, "c.a = '192.168.2.1'") + + def return_val(*args, **kwargs): return '192.168.1.1' diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 8d08c80..04cd2a8 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -469,7 +469,7 @@ class Option(OnlyOption): if transitive: raise err else: - pass + return getattr(self, func)(all_cons_opts, all_cons_vals, warnings_only) def impl_validate(self, value, context=undefined, validate=True,