can set owner for a slave
This commit is contained in:
@ -3,7 +3,7 @@ do_autopath()
|
||||
|
||||
from py.test import raises
|
||||
|
||||
from tiramisu.setting import owners
|
||||
from tiramisu.setting import owners, groups
|
||||
from tiramisu.config import Config
|
||||
from tiramisu.option import ChoiceOption, BoolOption, IntOption, FloatOption, \
|
||||
StrOption, OptionDescription, SymLinkOption
|
||||
@ -131,6 +131,7 @@ def test_setowner_optiondescription():
|
||||
descr1 = OptionDescription('tiramisu', '', [gcdummy])
|
||||
descr = OptionDescription('tiramisu', '', [descr1])
|
||||
cfg = Config(descr)
|
||||
cfg
|
||||
raises(ConfigError, 'cfg.cfgimpl_get_values().getowner(descr1)')
|
||||
raises(ConfigError, 'cfg.cfgimpl_get_values().setowner(descr1, owners.user)')
|
||||
|
||||
@ -145,3 +146,18 @@ def test_setowner_symlinkoption():
|
||||
cfg.tiramisu.dummy = True
|
||||
assert cfg.cfgimpl_get_values().getowner(s) == owners.user
|
||||
raises(ConfigError, 'cfg.cfgimpl_get_values().setowner(s, owners.user)')
|
||||
|
||||
|
||||
def test_owner_masterslaves():
|
||||
b = IntOption('int', 'Test int option', default=[0], multi=True)
|
||||
c = StrOption('str', 'Test string option', multi=True)
|
||||
descr = OptionDescription("int", "", [b, c])
|
||||
descr.impl_set_group_type(groups.master)
|
||||
cfg = Config(descr)
|
||||
raises(ConfigError, 'cfg.cfgimpl_get_values().setowner(c, owners.user)')
|
||||
|
||||
cfg.int.append(1)
|
||||
cfg.str[0] = 'yes'
|
||||
assert cfg.cfgimpl_get_values().getowner(c, 0) == owners.user
|
||||
cfg.cfgimpl_get_values().setowner(c, owners.user, 0)
|
||||
assert cfg.cfgimpl_get_values().getowner(c, 0) == owners.user
|
||||
|
Reference in New Issue
Block a user