add some optimisations

This commit is contained in:
2015-12-22 22:06:14 +01:00
parent 93ce93e529
commit df233d3165
6 changed files with 123 additions and 106 deletions

View File

@ -606,6 +606,20 @@ def test_set_item():
raises(ValueError, 'c.cfgimpl_get_settings()[a] = ("test",)')
def test_optiondescription_requires():
a = BoolOption('activate_service', '', True)
b = BoolOption('ip_address_service', '', multi=True)
a, b
OptionDescription('service', '', [b], requires=[{'option': a, 'expected': False, 'action': 'disabled'}])
def test_optiondescription_requires_multi():
a = BoolOption('activate_service', '', True)
b = IPOption('ip_address_service', '', multi=True)
a, b
raises(ValueError, "OptionDescription('service', '', [a], requires=[{'option': b, 'expected': False, 'action': 'disabled'}])")
def test_properties_conflict():
a = BoolOption('activate_service', '', True)
a

View File

@ -248,7 +248,6 @@ def test_diff_opt_cache():
s = SymLinkOption('s', u)
o = OptionDescription('o', '', [b, u, s])
o1 = OptionDescription('o1', '', [o])
o1.impl_build_cache_consistency()
o1.impl_build_cache_option()
a = dumps(o1)
@ -263,7 +262,6 @@ def test_diff_opt_callback():
b4 = BoolOption("b4", "", callback=return_value, callback_params={'': ((None,),), 'value': ('string',)})
o = OptionDescription('o', '', [b, b2, b3, b4])
o1 = OptionDescription('o1', '', [o])
o1.impl_build_cache_consistency()
o1.impl_build_cache_option()
a = dumps(o1)