diff --git a/tests/test_dyn_optiondescription.py b/tests/test_dyn_optiondescription.py index 30427fc..656cdd6 100644 --- a/tests/test_dyn_optiondescription.py +++ b/tests/test_dyn_optiondescription.py @@ -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() diff --git a/tiramisu/api.py b/tiramisu/api.py index 8fecd15..16b8aec 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -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()