diff --git a/tests/test_config.py b/tests/test_config.py index d7164c0..b6f3138 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -436,6 +436,7 @@ async def test_config_od_type(config_type): o2 = OptionDescription('val', '', [o]) async with await Config(o2) as cfg: cfg = await get_config(cfg, config_type) + assert await cfg.option('val').option.type() == 'optiondescription' assert await cfg.option('val.i').option.type() == 'integer' assert not await list_sessions() diff --git a/tiramisu/api.py b/tiramisu/api.py index e57b1ce..ec3ff58 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -407,6 +407,8 @@ class TiramisuOptionOption(_TiramisuOptionOptionDescription): @option_and_connection async def type(self): + if self._option_bag.option.impl_is_optiondescription(): + return 'optiondescription' return self._option_bag.option.get_type() @option_and_connection @@ -699,7 +701,8 @@ class TiramisuOptionValue(CommonTiramisuOption): flatten=False, withwarning: bool=False, fullpath=False, - leader_to_list=False): + leader_to_list=False, + ): """Dict with path as key and value""" name = self._option_bag.option.impl_getname() subconfig = await self._subconfig.get_subconfig(self._option_bag)