check optiondescription's type
This commit is contained in:
parent
477b0a2da1
commit
ba0634f163
2 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue