mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16:14 +02:00
add new message handling
This commit is contained in:
parent
f8b4460872
commit
85a45ab32c
10 changed files with 175 additions and 134 deletions
|
@ -1,21 +0,0 @@
|
|||
import textwrap
|
||||
|
||||
from jrnl.exception import JrnlException
|
||||
from jrnl.exception import JrnlExceptionMessage
|
||||
|
||||
|
||||
def test_config_directory_exception_message():
|
||||
ex = JrnlException(
|
||||
JrnlExceptionMessage.ConfigDirectoryIsFile,
|
||||
config_directory_path="/config/directory/path",
|
||||
)
|
||||
|
||||
assert ex.message == textwrap.dedent(
|
||||
"""
|
||||
The path to your jrnl configuration directory is a file, not a directory:
|
||||
|
||||
/config/directory/path
|
||||
|
||||
Removing this file will allow jrnl to save its configuration.
|
||||
"""
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
import pytest
|
||||
|
||||
from jrnl.exception import JrnlException
|
||||
from jrnl.exception import JrnlExceptionMessage
|
||||
|
||||
from jrnl.plugins.fancy_exporter import check_provided_linewrap_viability
|
||||
|
||||
|
||||
|
@ -24,8 +24,5 @@ class TestFancy:
|
|||
|
||||
total_linewrap = 12
|
||||
|
||||
with pytest.raises(JrnlException) as e:
|
||||
with pytest.raises(JrnlException):
|
||||
check_provided_linewrap_viability(total_linewrap, [content], journal)
|
||||
assert (
|
||||
e.value.exception_msg == JrnlExceptionMessage.LineWrapTooSmallForDateFormat
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue