add test for recursive path in requirement
authorEmmanuel Garette <egarette@cadoles.com>
Thu, 22 Aug 2013 20:57:32 +0000 (22:57 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Thu, 22 Aug 2013 20:57:32 +0000 (22:57 +0200)
test/test_requires.py

index 9376364..899c1c3 100644 (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')