tests on group types

This commit is contained in:
gwen 2012-12-05 09:41:53 +01:00
parent 0db34bbeba
commit 7784a82cde
2 changed files with 3 additions and 6 deletions

View 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():

View 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()