tests on group types
authorgwen <gremond@cadoles.com>
Wed, 5 Dec 2012 08:41:53 +0000 (09:41 +0100)
committergwen <gremond@cadoles.com>
Wed, 5 Dec 2012 08:41:53 +0000 (09:41 +0100)
test/test_parsing_group.py
tiramisu/config.py

index d28c59e..2e1e5ba 100644 (file)
@@ -23,7 +23,7 @@ def make_description():
 
     master = OptionDescription('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])
     interface1 = OptionDescription('interface1', '', [master])
-    interface1.set_group_type('group')
+    interface1.set_group_type('family')
 
     general = OptionDescription('general', '', [numero_etab, nom_machine,
                                              nombre_interfaces, activer_proxy_client,
@@ -63,9 +63,6 @@ def test_iter_on_groups():
     config = Config(descr)
     result = list(config.creole.iter_groups(group_type= "family"))
     group_names = [res[0] for res in result]
-    assert group_names == ['general']
-    result = list(config.creole.iter_groups())
-    group_names = [res[0] for res in result]
     assert group_names == ['general', 'interface1']
 
 def test_iter_on_empty_group():
index 84f1cc4..72f78e2 100644 (file)
@@ -97,7 +97,7 @@ class Config(object):
                 if child._name not in self._cfgimpl_values:
                     if child.is_multi():
                         self._cfgimpl_values[child._name] = Multi(
-                                copy(child.getdefault()), config=self, child=child)
+                                copy(child.getdefault()), config=self, opt=child)
                     else:
                         self._cfgimpl_values[child._name] = copy(child.getdefault())
                     child.setowner(self, 'default')
@@ -426,7 +426,7 @@ class Config(object):
 
     def __eq__(self, other):
         "Config comparison"
-        if not isinstance(other, OptionDescription):
+        if not isinstance(other, Config):
             return False
         return self.getkey() == other.getkey()