add isdynamic function

This commit is contained in:
Emmanuel Garette 2022-05-22 14:45:02 +02:00
parent d736d09e42
commit 7f78728ad1
2 changed files with 12 additions and 0 deletions

View file

@ -72,6 +72,8 @@ async def test_build_dyndescription():
od1 = OptionDescription('od', '', [dod])
async with await Config(od1) as cfg:
assert await cfg.value.dict() == {'dodval1.stval1': None, 'dodval2.stval2': None}
assert await cfg.option('dodval1').option.isdynamic()
assert await cfg.option('dodval1.stval1').option.isdynamic()
assert not await list_sessions()

View file

@ -182,6 +182,11 @@ class _TiramisuOptionOptionDescription(CommonTiramisuOption):
"""Test if option is a leader or a follower"""
return self._option_bag.option.impl_is_leadership()
@option_and_connection
async def isdynamic(self):
"""Test if option is a dynamic optiondescription"""
return self._option_bag.option.impl_is_dynoptiondescription()
@option_and_connection
async def doc(self):
"""Get option document"""
@ -278,6 +283,11 @@ class TiramisuOptionOption(_TiramisuOptionOptionDescription):
"""Test if option is a follower"""
return self._option_bag.option.impl_is_follower()
@option_and_connection
async def isdynamic(self):
"""Test if option is a dynamic optiondescription"""
return self._option_bag.option.impl_is_dynsymlinkoption()
@option_and_connection
async def issymlinkoption(self) -> bool:
return self._option_bag.option.impl_is_symlinkoption()