mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-05 07:56:14 +02:00
make format
This commit is contained in:
parent
7a54e6f458
commit
f1b260655d
3 changed files with 22 additions and 25 deletions
|
@ -9,10 +9,7 @@ def minimal_config():
|
|||
"colors": {"body": "red", "date": "green"},
|
||||
"default": "/tmp/journal.jrnl",
|
||||
"editor": "vim",
|
||||
"journals": {
|
||||
"default": "/tmp/journals/journal.jrnl"
|
||||
}
|
||||
|
||||
"journals": {"default": "/tmp/journals/journal.jrnl"},
|
||||
}
|
||||
yield cfg
|
||||
|
||||
|
@ -30,18 +27,20 @@ def test_override_dot_notation(minimal_config):
|
|||
cfg = apply_overrides(overrides=overrides, base_config=cfg)
|
||||
assert cfg["colors"] == {"body": "blue", "date": "green"}
|
||||
|
||||
def test_multiple_overrides(minimal_config):
|
||||
overrides = {
|
||||
"colors.title": "magenta",
|
||||
"editor": "nano",
|
||||
"journals.burner": "/tmp/journals/burner.jrnl"
|
||||
} # as returned by parse_args, saved in parser.config_override
|
||||
|
||||
def test_multiple_overrides(minimal_config):
|
||||
overrides = {
|
||||
"colors.title": "magenta",
|
||||
"editor": "nano",
|
||||
"journals.burner": "/tmp/journals/burner.jrnl",
|
||||
} # as returned by parse_args, saved in parser.config_override
|
||||
cfg = apply_overrides(overrides, minimal_config.copy())
|
||||
assert cfg["editor"] == "nano"
|
||||
assert cfg["editor"] == "nano"
|
||||
assert cfg["colors"]["title"] == "magenta"
|
||||
assert "burner" in cfg["journals"]
|
||||
assert cfg["journals"]["burner"] == "/tmp/journals/burner.jrnl"
|
||||
|
||||
|
||||
def test_recursively_apply():
|
||||
cfg = {"colors": {"body": "red", "title": "green"}}
|
||||
cfg = _recursively_apply(cfg, ["colors", "body"], "blue")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue