suppression of the override
This commit is contained in:
@ -54,16 +54,16 @@ def make_description_duplicates():
|
||||
return descr
|
||||
|
||||
def test_identical_paths():
|
||||
"""If in the schema (the option description) there is something that
|
||||
"""If in the schema (the option description) there is something that
|
||||
have the same name, an exection is raised
|
||||
"""
|
||||
"""
|
||||
descr = make_description_duplicates()
|
||||
raises(ConflictConfigError, "cfg = Config(descr)")
|
||||
|
||||
#def test_identical_for_names():
|
||||
# """if there is something that
|
||||
# """if there is something that
|
||||
# have the same name, an exection is raised
|
||||
# """
|
||||
# """
|
||||
# descr = make_description_duplicates()
|
||||
# raises(ConflictConfigError, "cfg = Config(descr)")
|
||||
|
||||
@ -73,7 +73,7 @@ def make_description2():
|
||||
gcdummy = BoolOption('dummy', 'dummy', default=False)
|
||||
|
||||
floatoption = FloatOption('float', 'Test float option', default=2.3)
|
||||
|
||||
|
||||
objspaceoption = ChoiceOption('objspace', 'Object space',
|
||||
['std', 'thunk'], 'std')
|
||||
booloption = BoolOption('bool', 'Test boolean option', default=True)
|
||||
@ -89,7 +89,7 @@ def make_description2():
|
||||
default=False,
|
||||
requires=['boolop'])
|
||||
wantframework_option.enable_multi()
|
||||
|
||||
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption])
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption, objspaceoption,
|
||||
wantref_option, stroption,
|
||||
@ -97,20 +97,20 @@ def make_description2():
|
||||
intoption, boolop])
|
||||
return descr
|
||||
|
||||
# FIXME: XXX would you mind putting the multi validations anywhere else
|
||||
# than in the requires !!!
|
||||
# FIXME: XXX would you mind putting the multi validations anywhere else
|
||||
# than in the requires !!!
|
||||
#def test_multi_constraints():
|
||||
# "a multi in a constraint has to have the same length"
|
||||
# descr = make_description2()
|
||||
# cfg = Config(descr)
|
||||
# cfg.boolop = [True, True, False]
|
||||
# cfg.wantframework = [False, False, True]
|
||||
#
|
||||
#
|
||||
#def test_multi_raise():
|
||||
# "a multi in a constraint has to have the same length"
|
||||
# # FIXME fusionner les deux tests, MAIS PROBLEME :
|
||||
# # il ne devrait pas etre necessaire de refaire une config
|
||||
# # si la valeur est modifiee une deuxieme fois ->
|
||||
# # si la valeur est modifiee une deuxieme fois ->
|
||||
# #raises(ConflictConfigError, "cfg.wantframework = [False, False, True]")
|
||||
# # ExceptionFailure: 'DID NOT RAISE'
|
||||
# descr = make_description2()
|
||||
@ -130,12 +130,14 @@ def test_newoption_add_in_subdescr():
|
||||
descr = make_description()
|
||||
newoption = BoolOption('newoption', 'dummy twoo', default=False)
|
||||
descr.gc.add_child(newoption)
|
||||
config = Config(descr, bool=False)
|
||||
config = Config(descr)
|
||||
config.bool = False
|
||||
assert config.gc.newoption == False
|
||||
|
||||
def test_newoption_add_in_config():
|
||||
descr = make_description()
|
||||
config = Config(descr, bool=False)
|
||||
config = Config(descr)
|
||||
config.bool = False
|
||||
newoption = BoolOption('newoption', 'dummy twoo', default=False)
|
||||
descr.add_child(newoption)
|
||||
config.cfgimpl_update()
|
||||
@ -146,14 +148,14 @@ def make_description_requires():
|
||||
gcdummy = BoolOption('dummy', 'dummy', default=False)
|
||||
|
||||
floatoption = FloatOption('float', 'Test float option', default=2.3)
|
||||
|
||||
|
||||
objspaceoption = ChoiceOption('objspace', 'Object space',
|
||||
['std', 'thunk'], 'std')
|
||||
booloption = BoolOption('bool', 'Test boolean option', default=True)
|
||||
intoption = IntOption('int', 'Test int option', default=0)
|
||||
stroption = StrOption('str', 'Test string option', default="abc",
|
||||
stroption = StrOption('str', 'Test string option', default="abc",
|
||||
requires=[('int', 1, 'hide')])
|
||||
|
||||
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption])
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption, objspaceoption,
|
||||
stroption, intoption])
|
||||
@ -175,15 +177,15 @@ def test_hidden_if_in_with_group():
|
||||
gcdummy = BoolOption('dummy', 'dummy', default=False)
|
||||
|
||||
floatoption = FloatOption('float', 'Test float option', default=2.3)
|
||||
|
||||
|
||||
objspaceoption = ChoiceOption('objspace', 'Object space',
|
||||
['std', 'thunk'], 'std')
|
||||
booloption = BoolOption('bool', 'Test boolean option', default=True)
|
||||
intoption = IntOption('int', 'Test int option', default=0)
|
||||
stroption = StrOption('str', 'Test string option', default="abc")
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption],
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption],
|
||||
requires=[('int', 1, 'hide')])
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption,
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption,
|
||||
objspaceoption, stroption, intoption])
|
||||
cfg = Config(descr)
|
||||
assert not gcgroup._is_hidden()
|
||||
@ -196,19 +198,18 @@ def test_disabled_with_group():
|
||||
gcdummy = BoolOption('dummy', 'dummy', default=False)
|
||||
|
||||
floatoption = FloatOption('float', 'Test float option', default=2.3)
|
||||
|
||||
|
||||
objspaceoption = ChoiceOption('objspace', 'Object space',
|
||||
['std', 'thunk'], 'std')
|
||||
booloption = BoolOption('bool', 'Test boolean option', default=True)
|
||||
intoption = IntOption('int', 'Test int option', default=0)
|
||||
stroption = StrOption('str', 'Test string option', default="abc")
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption],
|
||||
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption],
|
||||
requires=[('int', 1, 'disable')])
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption,
|
||||
descr = OptionDescription('constraints', '', [gcgroup, booloption,
|
||||
objspaceoption, stroption, intoption])
|
||||
cfg = Config(descr)
|
||||
assert not gcgroup._is_disabled()
|
||||
cfg.int = 1
|
||||
raises(PropertiesOptionError, "cfg.gc.name")
|
||||
assert gcgroup._is_disabled()
|
||||
|
||||
|
Reference in New Issue
Block a user