add extend in config setting
This commit is contained in:
parent
c175519211
commit
d3f9d20ab5
|
@ -310,6 +310,15 @@ def test_access_by_get_whith_hide():
|
|||
raises(AttributeError, "c.find(byname='b1')")
|
||||
|
||||
|
||||
def test_extend_config_properties():
|
||||
descr = make_description()
|
||||
cfg = Config(descr)
|
||||
setting = cfg.cfgimpl_get_settings()
|
||||
assert str(setting) == str(['cache', 'expire', 'validator'])
|
||||
setting.extend(['test', 'test2'])
|
||||
assert str(setting) == str(['test', 'cache', 'test2', 'expire', 'validator'])
|
||||
|
||||
|
||||
def test_append_properties():
|
||||
descr = make_description()
|
||||
cfg = Config(descr)
|
||||
|
|
|
@ -408,6 +408,10 @@ class Settings(object):
|
|||
props.remove(propname)
|
||||
self._setproperties(props, None, None)
|
||||
|
||||
def extend(self, propnames):
|
||||
for propname in propnames:
|
||||
self.append(propname)
|
||||
|
||||
def _setproperties(self, properties, opt, path):
|
||||
"""save properties for specified opt
|
||||
(never save properties if same has option properties)
|
||||
|
|
Loading…
Reference in New Issue