add fullpath to make_dict
This commit is contained in:
@ -134,6 +134,24 @@ def test_make_dict_with_disabled_in_callback():
|
||||
assert d == {"s1.a": False, "int": 42}
|
||||
|
||||
|
||||
def test_make_dict_fullpath():
|
||||
descr = OptionDescription("root", "", [
|
||||
OptionDescription("opt", "", [
|
||||
OptionDescription("s1", "", [
|
||||
BoolOption("a", "", default=False),
|
||||
BoolOption("b", "", default=False, properties=('disabled',))]),
|
||||
OptionDescription("s2", "", [
|
||||
BoolOption("a", "", default=False),
|
||||
BoolOption("b", "", default=False)], properties=('disabled',)),
|
||||
IntOption("int", "", default=42)]),
|
||||
IntOption("introot", "", default=42)])
|
||||
config = Config(descr)
|
||||
config.read_only()
|
||||
assert config.make_dict() == {"opt.s1.a": False, "opt.int": 42, "introot": 42}
|
||||
assert config.opt.make_dict() == {"s1.a": False, "int": 42}
|
||||
assert config.opt.make_dict(fullpath=True) == {"opt.s1.a": False, "opt.int": 42}
|
||||
|
||||
|
||||
def test_find_in_config():
|
||||
"finds option in config"
|
||||
descr = make_description()
|
||||
|
Reference in New Issue
Block a user