mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16:14 +02:00
move exception for no alt config to new handling
This commit is contained in:
parent
782adef681
commit
0b160aa845
3 changed files with 17 additions and 10 deletions
|
@ -2,6 +2,7 @@ import pytest
|
|||
import os
|
||||
|
||||
from jrnl.install import find_alt_config
|
||||
from jrnl.exception import JrnlException
|
||||
|
||||
|
||||
def test_find_alt_config(request):
|
||||
|
@ -14,9 +15,9 @@ def test_find_alt_config(request):
|
|||
|
||||
def test_find_alt_config_not_exist(request):
|
||||
bad_config_path = os.path.join(
|
||||
request.fspath.dirname, "..", "data", "configs", "not-existing-config.yaml"
|
||||
request.fspath.dirname, "..", "data", "configs", "does-not-exist.yaml"
|
||||
)
|
||||
with pytest.raises(SystemExit) as ex:
|
||||
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, SystemExit)
|
||||
assert isinstance(ex.value, JrnlException)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue