jrnl/tests/unit/test_config_file.py
Jonathan Wren 4eb9c9fdec
Clean up copyright notices and version screen (#1553)
* update copyright symbols to unicode

* clean up version screen/copyright notice

* small change to make commands more similar

* update imports to appease isort

* fix test

* update one more file merged since PR was open
2022-08-21 14:17:35 -07:00

27 lines
832 B
Python

# Copyright © 2012-2022 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import os
import pytest
from jrnl.exception import JrnlException
from jrnl.install import find_alt_config
def test_find_alt_config(request):
work_config_path = os.path.join(
request.fspath.dirname, "..", "data", "configs", "basic_onefile.yaml"
)
found_alt_config = find_alt_config(work_config_path)
assert found_alt_config == work_config_path
def test_find_alt_config_not_exist(request):
bad_config_path = os.path.join(
request.fspath.dirname, "..", "data", "configs", "does-not-exist.yaml"
)
with pytest.raises(JrnlException) as ex:
found_alt_config = find_alt_config(bad_config_path)
assert found_alt_config is not None
assert isinstance(ex.value, JrnlException)