From 163b554ee93fea555522e39e3a51e898b1b10958 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 21 Feb 2018 21:08:40 +0100 Subject: [PATCH] change for tiramisu 2.2 --- test/new_api/test_choice_option.py | 2 +- tiramisu/api.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/new_api/test_choice_option.py b/test/new_api/test_choice_option.py index 02e253e..c6ef2dc 100644 --- a/test/new_api/test_choice_option.py +++ b/test/new_api/test_choice_option.py @@ -134,7 +134,7 @@ def test_choiceoption_calc_opt_function_propertyerror(): cfg = Config(odesc) api = getapi(cfg) api.property.read_write() - raises(ConfigError, "api.option('choice').value.set('no')") + raises(ValueError, "api.option('choice').value.set('no')") def test_choiceoption_calc_opt_multi_function(): diff --git a/tiramisu/api.py b/tiramisu/api.py index 531b20e..9290335 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -241,7 +241,6 @@ class TiramisuOptionOption(CommonTiramisuOption): return self._get_option().impl_is_optiondescription() - class TiramisuOptionOwner(CommonTiramisuOption): """manager option's owner""" allow_unrestraint = True @@ -373,7 +372,7 @@ class TiramisuOptionPermissive(CommonTiramisuOption): def get(self): """get permissive value for a specified path""" if TIRAMISU_VERSION == 2: - args = [self.setting_properties, self.path] + args = [self.setting_properties, self._path] else: args = [self._get_option(), self.path] return self.settings.getpermissive(*args) @@ -382,9 +381,12 @@ class TiramisuOptionPermissive(CommonTiramisuOption): def set(self, permissives): if TIRAMISU_VERSION == 2: permissive = tuple(permissives) - self.settings.setpermissive(opt=self._get_option(), - path=self.path, - permissives=permissives) + path = self._path + else: + path = self.path + self.settings.setpermissive(opt=self._opt, + path=path, + permissive=permissive) @count def reset(self, path):