add isdynamic function
This commit is contained in:
parent
d736d09e42
commit
7f78728ad1
2 changed files with 12 additions and 0 deletions
|
@ -72,6 +72,8 @@ async def test_build_dyndescription():
|
||||||
od1 = OptionDescription('od', '', [dod])
|
od1 = OptionDescription('od', '', [dod])
|
||||||
async with await Config(od1) as cfg:
|
async with await Config(od1) as cfg:
|
||||||
assert await cfg.value.dict() == {'dodval1.stval1': None, 'dodval2.stval2': None}
|
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()
|
assert not await list_sessions()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,11 @@ class _TiramisuOptionOptionDescription(CommonTiramisuOption):
|
||||||
"""Test if option is a leader or a follower"""
|
"""Test if option is a leader or a follower"""
|
||||||
return self._option_bag.option.impl_is_leadership()
|
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
|
@option_and_connection
|
||||||
async def doc(self):
|
async def doc(self):
|
||||||
"""Get option document"""
|
"""Get option document"""
|
||||||
|
@ -278,6 +283,11 @@ class TiramisuOptionOption(_TiramisuOptionOptionDescription):
|
||||||
"""Test if option is a follower"""
|
"""Test if option is a follower"""
|
||||||
return self._option_bag.option.impl_is_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
|
@option_and_connection
|
||||||
async def issymlinkoption(self) -> bool:
|
async def issymlinkoption(self) -> bool:
|
||||||
return self._option_bag.option.impl_is_symlinkoption()
|
return self._option_bag.option.impl_is_symlinkoption()
|
||||||
|
|
Loading…
Reference in a new issue