move override implementation into own module

This commit is contained in:
Suhas 2021-01-24 07:17:53 -05:00
parent 1a8bcfca64
commit 9676290c27
3 changed files with 38 additions and 4 deletions

27
tests/test_override.py Normal file
View 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'