pass force_properties to value's _setitem and remove config's setoption
This commit is contained in:
@ -245,7 +245,7 @@ def test_has_callback():
|
||||
setting.add_property('frozen', dummy)
|
||||
raises(PropertiesOptionError, "config.gc.dummy = True")
|
||||
|
||||
def test_freeze_and_has_callback_with_setoption():
|
||||
def test_freeze_and_has_callback():
|
||||
descr = make_description_callback()
|
||||
config = Config(descr)
|
||||
setting = config.cfgimpl_get_settings()
|
||||
@ -254,5 +254,5 @@ def test_freeze_and_has_callback_with_setoption():
|
||||
config.cfgimpl_get_settings().enable_property('freeze')
|
||||
dummy = config.unwrap_from_path('gc.dummy')
|
||||
config.cfgimpl_get_settings().add_property('frozen', dummy)
|
||||
raises(PropertiesOptionError, "config.gc.setoption('dummy', descr.gc.dummy, True)")
|
||||
raises(PropertiesOptionError, "config.gc.dummy = True")
|
||||
#____________________________________________________________
|
||||
|
@ -398,8 +398,7 @@ def test_allow_multiple_changes_from_config():
|
||||
suboption = OptionDescription("bip", "", [s2])
|
||||
descr = OptionDescription("options", "", [s, suboption])
|
||||
config = Config(descr)
|
||||
config.setoption("string", s, 'blah')
|
||||
config.setoption("string", s, "oh")
|
||||
config.string = "oh"
|
||||
assert config.string == "oh"
|
||||
config.set(string2='blah')
|
||||
assert config.bip.string2 == 'blah'
|
||||
|
@ -13,7 +13,7 @@ def make_description():
|
||||
gcoption = ChoiceOption('name', 'GC name', ('ref', 'framework'), 'ref')
|
||||
gcdummy = BoolOption('dummy', 'dummy', default=False, properties=(('hidden'),))
|
||||
objspaceoption = ChoiceOption('objspace', 'Object space',
|
||||
('std', 'thunk'), 'std')
|
||||
('std', 'thunk'), ['std'], multi=True)
|
||||
booloption = BoolOption('bool', 'Test boolean option', default=True)
|
||||
intoption = IntOption('int', 'Test int option', default=0)
|
||||
floatoption = FloatOption('float', 'Test float option', default=2.3)
|
||||
@ -68,7 +68,33 @@ def test_group_is_hidden():
|
||||
assert not config.cfgimpl_get_settings().has_property('hidden', gc)
|
||||
assert config.gc.float == 2.3
|
||||
#dummy est en hide
|
||||
raises(PropertiesOptionError, "config.gc.dummy == False")
|
||||
prop = []
|
||||
try:
|
||||
config.gc.dummy = False
|
||||
except PropertiesOptionError, err:
|
||||
prop = err.proptype
|
||||
assert 'hidden' in prop
|
||||
|
||||
|
||||
def test_group_is_hidden_multi():
|
||||
descr = make_description()
|
||||
config = Config(descr)
|
||||
setting = config.cfgimpl_get_settings()
|
||||
setting.read_write()
|
||||
obj = config.unwrap_from_path('objspace')
|
||||
objspace = config.objspace
|
||||
config.cfgimpl_get_settings().add_property('hidden', obj)
|
||||
raises(PropertiesOptionError, "config.objspace")
|
||||
assert config.cfgimpl_get_settings().has_property('hidden', obj)
|
||||
prop = []
|
||||
try:
|
||||
objspace.append('std')
|
||||
except PropertiesOptionError, err:
|
||||
prop = err.proptype
|
||||
assert 'hidden' in prop
|
||||
config.cfgimpl_get_settings().del_property('hidden', obj)
|
||||
assert not config.cfgimpl_get_settings().has_property('hidden', obj)
|
||||
config.objspace.append('std')
|
||||
|
||||
|
||||
def test_global_show():
|
||||
|
Reference in New Issue
Block a user