mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16:14 +02:00
fixed name-clash + unit tests
This commit is contained in:
parent
680b942325
commit
240e85d7d5
4 changed files with 34 additions and 3 deletions
17
tests/test_config_file.py
Normal file
17
tests/test_config_file.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import pytest
|
||||
|
||||
from jrnl.install import find_alt_config
|
||||
|
||||
|
||||
def test_find_alt_config():
|
||||
work_config_path = "features/data/configs/work-config.yaml"
|
||||
found_alt_config = find_alt_config(work_config_path)
|
||||
assert found_alt_config == work_config_path
|
||||
|
||||
|
||||
def test_find_alt_config_not_exist():
|
||||
bad_config_path = "features/data/configs/not-existing-config.yaml"
|
||||
with pytest.raises(SystemExit) as ex:
|
||||
found_alt_config = find_alt_config(bad_config_path)
|
||||
assert found_alt_config is not None
|
||||
assert isinstance(ex.value, SystemExit)
|
|
@ -37,6 +37,7 @@ def expected_args(**kwargs):
|
|||
"tags": False,
|
||||
"text": [],
|
||||
"config_override": [],
|
||||
"config_file_path": "",
|
||||
}
|
||||
return {**default_args, **kwargs}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue