You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shepherd-agent/tests/test_config.py

19 lines
618 B

import shepherd.config as config
def test_freeze():
confdef = config.ConfDefinition()
conf_def_dict = confdef.add_def('dictval', config.DictDef())
conf_def_dict.add_def('intval', config.IntDef())
conf_def_dict.add_def('strtval', config.StringDef())
confman = config.ConfigManager()
confman.add_confdef("test_bundle",confdef)
confman.load({"test_bundle": {'dictval': {'intval': 34, 'strval': "a"}}})
confman.freeze_value("test_bundle","dictval", "intval")
confman.load({"test_bundle": {'dictval': {'intval': 34, 'strval': "b"}}})
breakpoint()
print(confman.root_config)