diff --git a/tests/test_symlink.py b/tests/test_symlink.py index 908b271..5a75a0d 100644 --- a/tests/test_symlink.py +++ b/tests/test_symlink.py @@ -28,6 +28,8 @@ def test_symlink_option(config_type): assert cfg.option('c').issymlinkoption() assert cfg.option('s1.b').type() == 'boolean' assert cfg.option('c').type() == 'boolean' + assert cfg.option('s1.b').type(only_self=True) == 'boolean' + assert cfg.option('c').type(only_self=True) == 'symlink' assert cfg.option('s1.b').value.get() is False cfg.option("s1.b").value.set(True) cfg.option("s1.b").value.set(False) diff --git a/tiramisu/api.py b/tiramisu/api.py index c982377..4f441c1 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -348,11 +348,13 @@ class _TiramisuOptionOptionDescription: return options @option_type(["option", "optiondescription", "symlink", "with_or_without_index"]) - def type(self): + def type(self, only_self=False): """Get de option type""" option = self._subconfig.option if option.impl_is_optiondescription(): return "optiondescription" + if only_self and option.impl_is_symlinkoption(): + return 'symlink' return option.get_type() @option_type(["option", "symlink", "with_or_without_index"])