values are in value objects now
This commit is contained in:
@ -5,7 +5,6 @@ from py.test import raises
|
||||
|
||||
from tiramisu.config import *
|
||||
from tiramisu.option import *
|
||||
from tiramisu.setting import settings
|
||||
|
||||
def make_description():
|
||||
gcoption = ChoiceOption('name', 'GC name', ['ref', 'framework'], 'ref')
|
||||
@ -64,6 +63,7 @@ def make_description_freeze():
|
||||
def test_freeze_whole_config():
|
||||
descr = make_description_freeze()
|
||||
conf = Config(descr)
|
||||
settings = conf.cfgimpl_get_settings()
|
||||
settings.freeze_everything()
|
||||
assert conf.gc.dummy == False
|
||||
raises(TypeError, "conf.gc.dummy = True")
|
||||
@ -85,6 +85,7 @@ def test_frozen_value():
|
||||
s = StrOption("string", "", default="string")
|
||||
descr = OptionDescription("options", "", [s])
|
||||
config = Config(descr)
|
||||
settings = config.cfgimpl_get_settings()
|
||||
settings.freeze()
|
||||
s.freeze()
|
||||
raises(TypeError, 'config.string = "egg"')
|
||||
@ -93,6 +94,7 @@ def test_freeze():
|
||||
"freeze a whole configuration object"
|
||||
descr = make_description()
|
||||
conf = Config(descr)
|
||||
settings = conf.cfgimpl_get_settings()
|
||||
settings.freeze()
|
||||
name = conf.unwrap_from_path("gc.name")
|
||||
name.freeze()
|
||||
@ -107,9 +109,8 @@ def test_is_hidden():
|
||||
# getattr
|
||||
raises(PropertiesOptionError, "config.gc.dummy")
|
||||
# I want to access to this option anyway
|
||||
path = 'gc.dummy'
|
||||
homeconfig, name = config._cfgimpl_get_home_by_path(path)
|
||||
assert homeconfig._cfgimpl_values[name] == False
|
||||
opt = config.unwrap_from_path("gc.dummy")
|
||||
assert config._cfgimpl_context._cfgimpl_values[opt] == False
|
||||
|
||||
def test_group_is_hidden():
|
||||
descr = make_description()
|
||||
|
Reference in New Issue
Block a user