change for tiramisu 2.2

This commit is contained in:
Emmanuel Garette 2018-02-21 21:08:40 +01:00
parent d4cf1faff8
commit 163b554ee9
2 changed files with 8 additions and 6 deletions

View File

@ -134,7 +134,7 @@ def test_choiceoption_calc_opt_function_propertyerror():
cfg = Config(odesc) cfg = Config(odesc)
api = getapi(cfg) api = getapi(cfg)
api.property.read_write() 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(): def test_choiceoption_calc_opt_multi_function():

View File

@ -241,7 +241,6 @@ class TiramisuOptionOption(CommonTiramisuOption):
return self._get_option().impl_is_optiondescription() return self._get_option().impl_is_optiondescription()
class TiramisuOptionOwner(CommonTiramisuOption): class TiramisuOptionOwner(CommonTiramisuOption):
"""manager option's owner""" """manager option's owner"""
allow_unrestraint = True allow_unrestraint = True
@ -373,7 +372,7 @@ class TiramisuOptionPermissive(CommonTiramisuOption):
def get(self): def get(self):
"""get permissive value for a specified path""" """get permissive value for a specified path"""
if TIRAMISU_VERSION == 2: if TIRAMISU_VERSION == 2:
args = [self.setting_properties, self.path] args = [self.setting_properties, self._path]
else: else:
args = [self._get_option(), self.path] args = [self._get_option(), self.path]
return self.settings.getpermissive(*args) return self.settings.getpermissive(*args)
@ -382,9 +381,12 @@ class TiramisuOptionPermissive(CommonTiramisuOption):
def set(self, permissives): def set(self, permissives):
if TIRAMISU_VERSION == 2: if TIRAMISU_VERSION == 2:
permissive = tuple(permissives) permissive = tuple(permissives)
self.settings.setpermissive(opt=self._get_option(), path = self._path
path=self.path, else:
permissives=permissives) path = self.path
self.settings.setpermissive(opt=self._opt,
path=path,
permissive=permissive)
@count @count
def reset(self, path): def reset(self, path):