diff --git a/tests/test_option.py b/tests/test_option.py index 7377256..92d1b3f 100644 --- a/tests/test_option.py +++ b/tests/test_option.py @@ -66,6 +66,21 @@ def test_option_get_information_config(): assert i.impl_get_information('doc') == description +def test_option_get_information_default(): + description = "it's ok" + string = 'some informations' + string + i = IntOption('test', description) + i.impl_set_information('noinfo', 'optdefault') + od = OptionDescription('od', '', [i]) + cfg = Config(od) + # + assert cfg.option('test').information.get('noinfo', 'falsedefault') == 'optdefault' + # + cfg.option('test').information.set('noinfo', 'notdefault') + assert cfg.option('test').information.get('noinfo', 'falsedefault') == 'notdefault' + + def test_option_get_information_config2(): description = "it's ok" string = 'some informations' diff --git a/tiramisu/api.py b/tiramisu/api.py index 609d0c5..756a5a6 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -464,7 +464,7 @@ class TiramisuOptionInformation(CommonTiramisuOption): path = self._option_bag.path values = self._option_bag.config_bag.context.cfgimpl_get_values() try: - return values.get_information(key, default, path=path) + return values.get_information(key, path=path) except ValueError: option = self._option_bag.option return option.impl_get_information(key, default)