mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-04 23:46:14 +02:00
move override implementation into own module
This commit is contained in:
parent
1a8bcfca64
commit
9676290c27
3 changed files with 38 additions and 4 deletions
27
tests/test_override.py
Normal file
27
tests/test_override.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import pytest
|
||||
|
||||
import mock
|
||||
|
||||
from jrnl.args import parse_args
|
||||
from jrnl.jrnl import run, search_mode
|
||||
from jrnl import install
|
||||
from jrnl.override import apply_overrides
|
||||
@pytest.fixture()
|
||||
def minimal_config():
|
||||
cfg = {
|
||||
"colors":{
|
||||
"body":"red",
|
||||
"date":"green"
|
||||
},
|
||||
"default":"/tmp/journal.jrnl",
|
||||
"editor":"vim"
|
||||
}
|
||||
yield cfg
|
||||
|
||||
def test_apply_override(minimal_config):
|
||||
config = minimal_config.copy()
|
||||
overrides = {
|
||||
'editor':'nano'
|
||||
}
|
||||
config = apply_overrides(overrides, config)
|
||||
assert config['editor']=='nano'
|
Loading…
Add table
Add a link
Reference in a new issue