add test for recursive path in requirement

This commit is contained in:
Emmanuel Garette 2013-08-22 22:57:32 +02:00
parent f8422c03e8
commit ac62931525
1 changed files with 11 additions and 0 deletions

View File

@ -439,3 +439,14 @@ def test_requires_requirement_append():
c = Config(od)
c.read_write()
raises(ValueError, 'c.cfgimpl_get_settings()[b].append("disabled")')
def test_requires_recursive_path():
a = BoolOption('activate_service', '', True)
b = IPOption('ip_address_service', '',
requires=[{'option': a, 'expected': False, 'action': 'disabled'}])
od1 = OptionDescription('service', '', [a, b], requires=[{'option': a, 'expected': False, 'action': 'disabled'}])
od = OptionDescription('base', '', [od1])
c = Config(od)
c.read_write()
raises(RequirementError, 'c.service.a')