commented code for unicity by name

This commit is contained in:
gwen
2012-08-16 11:42:24 +02:00
parent dc99bbc44e
commit d8370b008b
2 changed files with 35 additions and 4 deletions

View File

@ -42,22 +42,32 @@ def make_description_duplicates():
wantframework_option = BoolOption('wantframework', 'Test requires',
default=False,
requires=['boolop'])
# dummy2 (same name)
# dummy2 (same path)
gcdummy2 = BoolOption('dummy', 'dummy2', default=True)
# dummy3 (same name)
gcdummy3 = BoolOption('dummy', 'dummy2', default=True)
gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, gcdummy2, floatoption])
descr = OptionDescription('constraints', '', [gcgroup, booloption, objspaceoption,
wantref_option, stroption,
wantframework_option,
intoption, boolop])
intoption, boolop, gcdummy3])
return descr
def test_identical_names():
def test_identical_paths():
"""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
# have the same name, an exection is raised
# """
# descr = make_description_duplicates()
# raises(ConflictConfigError, "cfg = Config(descr)")
def make_description2():
gcoption = ChoiceOption('name', 'GC name', ['ref', 'framework'], 'ref')
gcdummy = BoolOption('dummy', 'dummy', default=False)
@ -202,4 +212,3 @@ def test_disabled_with_group():
raises(PropertiesOptionError, "cfg.gc.name")
assert gcgroup._is_disabled()