rewrite make_dict
This commit is contained in:
@ -122,13 +122,13 @@ def test_make_dict():
|
||||
BoolOption("a", "", default=False)]),
|
||||
IntOption("int", "", default=42)])
|
||||
config = Config(descr)
|
||||
d = make_dict(config)
|
||||
d = config.make_dict()
|
||||
assert d == {"s1.a": False, "int": 42}
|
||||
config.int = 43
|
||||
config.s1.a = True
|
||||
d = make_dict(config)
|
||||
d = config.make_dict()
|
||||
assert d == {"s1.a": True, "int": 43}
|
||||
d2 = make_dict(config, flatten=True)
|
||||
d2 = config.make_dict(flatten=True)
|
||||
assert d2 == {'a': True, 'int': 43}
|
||||
|
||||
#def test_delattr():
|
||||
|
@ -46,12 +46,12 @@ def test_base_config():
|
||||
'general.mode_conteneur_actif': False, 'general.time_zone': 'Paris',
|
||||
'interface1.ip_admin_eth0.netmask_admin_eth0': None, 'general.nom_machine':
|
||||
'eoleng', 'general.activer_proxy_client': False}
|
||||
assert make_dict(config.creole) == result
|
||||
assert config.creole.make_dict() == result
|
||||
result = {'serveur_ntp': [], 'mode_conteneur_actif': False,
|
||||
'ip_admin_eth0': None, 'time_zone': 'Paris', 'numero_etab': None,
|
||||
'netmask_admin_eth0': None, 'nom_machine': 'eoleng', 'activer_proxy_client':
|
||||
False, 'nombre_interfaces': 1}
|
||||
assert make_dict(config.creole, flatten=True) == result
|
||||
assert config.creole.make_dict(flatten=True) == result
|
||||
|
||||
def test_get_group_type():
|
||||
descr = make_description()
|
||||
|
Reference in New Issue
Block a user