option's name shall not have an api's method name
This commit is contained in:
@ -43,3 +43,21 @@ def test_root_config_answers_ok():
|
||||
settings.enable_property('hiddend') #cfgimpl_hide()
|
||||
assert cfg.dummy == False
|
||||
assert cfg.boolop == True
|
||||
|
||||
def test_optname_shall_not_start_with_numbers():
|
||||
"if you hide the root config, the options in this namespace behave normally"
|
||||
gcdummy = BoolOption('123dummy', 'dummy', default=False)
|
||||
boolop = BoolOption('boolop', 'Test boolean option op', default=True)
|
||||
descr = OptionDescription('tiramisu', '', [gcdummy, boolop])
|
||||
cfg = Config(descr)
|
||||
# FIXME devrait lever une exception NameError
|
||||
settings = cfg.cfgimpl_get_settings()
|
||||
settings.enable_property('hiddend') #cfgimpl_hide()
|
||||
# assert cfg.123dummy == False
|
||||
assert cfg.boolop == True
|
||||
|
||||
def test_option_has_an_api_name():
|
||||
gcdummy = BoolOption('cfgimpl_get_settings', 'dummy', default=False)
|
||||
boolop = BoolOption('boolop', 'Test boolean option op', default=True)
|
||||
descr = OptionDescription('tiramisu', '', [gcdummy, boolop])
|
||||
raises(NameError, "cfg = Config(descr)")
|
||||
|
Reference in New Issue
Block a user