refactor recursive code

This commit is contained in:
Suhas 2021-01-24 19:14:46 -05:00
parent d348dbd55e
commit 9540d34964
2 changed files with 21 additions and 8 deletions

View file

@ -32,3 +32,9 @@ def test_recursive_override(minimal_config):
cfg = {"colors": {"body": "red", "title": "green"}}
cfg = recursively_apply(cfg, ["colors", "body"], "blue")
assert cfg["colors"]["body"] == "blue"
def test_get_config_node(minimal_config):
assert len(minimal_config.keys()) == 3
assert _get_config_node(minimal_config, "editor") == "vim"
assert _get_config_node(minimal_config, "display_format") == None