correction in fullpath option
authorEmmanuel Garette <egarette@cadoles.com>
Mon, 9 Jan 2017 19:16:33 +0000 (20:16 +0100)
committerEmmanuel Garette <egarette@cadoles.com>
Mon, 9 Jan 2017 19:16:38 +0000 (20:16 +0100)
ChangeLog
test/test_config_api.py
tiramisu/config.py

index 1be2c27..e5aa862 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Mon Jan  9 20:12:02 2017 +0200 Emmanuel Garette <egarette@cadoles.com>
+       * make_dict has new fullpath option
+
 Wed Nov 16 22:30:12 2016 +0200 Emmanuel Garette <egarette@cadoles.com>
        * consistency "not_equal" works now with multi and submulti
        * a multi or submulti could be "unique" (same value one time)
index 2bd1adc..b96607a 100644 (file)
@@ -149,6 +149,7 @@ def test_make_dict_fullpath():
     config.read_only()
     assert config.make_dict() == {"opt.s1.a": False, "opt.int": 42, "introot": 42}
     assert config.opt.make_dict() == {"s1.a": False, "int": 42}
+    assert config.make_dict(fullpath=True) == {"opt.s1.a": False, "opt.int": 42, "introot": 42}
     assert config.opt.make_dict(fullpath=True) == {"opt.s1.a": False, "opt.int": 42}
 
 
index 9dd96d8..43ac14d 100644 (file)
@@ -545,7 +545,11 @@ class SubConfig(object):
                     name = opt.impl_getname()
                 else:
                     if fullpath:
-                        name = '.'.join([self._impl_path,  opt.impl_getname()])
+                        root_path = self.cfgimpl_get_path()
+                        if root_path is None:
+                            name = opt.impl_getname()
+                        else:
+                            name = '.'.join([root_path, opt.impl_getname()])
                     else:
                         name = '.'.join(_currpath + [opt.impl_getname()])
                 pathsvalues.append((name, value))