tests
This commit is contained in:
parent
163b554ee9
commit
0d5c1c32ca
|
@ -146,7 +146,7 @@ def test_setowner_symlinkoption():
|
||||||
assert api.option('tiramisu.symdummy').owner.isdefault()
|
assert api.option('tiramisu.symdummy').owner.isdefault()
|
||||||
api.option('tiramisu.dummy').value.set(True)
|
api.option('tiramisu.dummy').value.set(True)
|
||||||
assert not api.option('tiramisu.symdummy').owner.isdefault()
|
assert not api.option('tiramisu.symdummy').owner.isdefault()
|
||||||
raises(TypeError, "api.option('tiramisu.symdummy').owner.set('user')")
|
raises(ConfigError, "api.option('tiramisu.symdummy').owner.set('user')")
|
||||||
|
|
||||||
|
|
||||||
def test_owner_masterslaves():
|
def test_owner_masterslaves():
|
||||||
|
|
|
@ -380,13 +380,18 @@ class TiramisuOptionPermissive(CommonTiramisuOption):
|
||||||
@count
|
@count
|
||||||
def set(self, permissives):
|
def set(self, permissives):
|
||||||
if TIRAMISU_VERSION == 2:
|
if TIRAMISU_VERSION == 2:
|
||||||
permissive = tuple(permissives)
|
permissives = tuple(permissives)
|
||||||
path = self._path
|
path = self._path
|
||||||
|
opt = self._opt
|
||||||
|
self.settings.setpermissive(opt=opt,
|
||||||
|
path=path,
|
||||||
|
permissive=permissives)
|
||||||
else:
|
else:
|
||||||
path = self.path
|
path = self.path
|
||||||
self.settings.setpermissive(opt=self._opt,
|
opt = self._get_option()
|
||||||
|
self.settings.setpermissive(opt=opt,
|
||||||
path=path,
|
path=path,
|
||||||
permissive=permissive)
|
permissives=permissives)
|
||||||
|
|
||||||
@count
|
@count
|
||||||
def reset(self, path):
|
def reset(self, path):
|
||||||
|
|
|
@ -236,8 +236,8 @@ class SubConfig(object):
|
||||||
nconfig_bag = config_bag.copy('nooption')
|
nconfig_bag = config_bag.copy('nooption')
|
||||||
nconfig_bag.option = opt
|
nconfig_bag.option = opt
|
||||||
name = opt.impl_getname()
|
name = opt.impl_getname()
|
||||||
subpath = self._get_subpath(name)
|
|
||||||
if nconfig_bag.setting_properties is not None:
|
if nconfig_bag.setting_properties is not None:
|
||||||
|
subpath = self._get_subpath(name)
|
||||||
try:
|
try:
|
||||||
context.cfgimpl_get_settings().validate_properties(subpath,
|
context.cfgimpl_get_settings().validate_properties(subpath,
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -447,7 +447,7 @@ class OptionDescription(OptionDescriptionWalk):
|
||||||
"""
|
"""
|
||||||
if not isinstance(children, list):
|
if not isinstance(children, list):
|
||||||
raise ValueError(_('children in optiondescription "{}" must be a list').format(name))
|
raise ValueError(_('children in optiondescription "{}" must be a list').format(name))
|
||||||
super(OptionDescription, self).__init__(name,
|
super().__init__(name,
|
||||||
doc=doc,
|
doc=doc,
|
||||||
requires=requires,
|
requires=requires,
|
||||||
properties=properties)
|
properties=properties)
|
||||||
|
|
|
@ -531,10 +531,10 @@ class Values(object):
|
||||||
"""
|
"""
|
||||||
opt = config_bag.option
|
opt = config_bag.option
|
||||||
if opt.impl_is_symlinkoption():
|
if opt.impl_is_symlinkoption():
|
||||||
raise TypeError(_("can't set owner for the SymLinkOption \"{}\""
|
raise ConfigError(_("can't set owner for the SymLinkOption \"{}\""
|
||||||
"").format(opt.impl_get_display_name()))
|
"").format(opt.impl_get_display_name()))
|
||||||
if not isinstance(owner, owners.Owner):
|
if not isinstance(owner, owners.Owner):
|
||||||
raise TypeError(_("invalid owner {0}").format(str(owner)))
|
raise ConfigError(_("invalid owner {0}").format(str(owner)))
|
||||||
|
|
||||||
if owner in forbidden_owners:
|
if owner in forbidden_owners:
|
||||||
raise ConfigError(_('set owner "{0}" is forbidden').format(str(owner)))
|
raise ConfigError(_('set owner "{0}" is forbidden').format(str(owner)))
|
||||||
|
|
Loading…
Reference in New Issue