jrnl/tests/unit/test_exception.py
Jonathan Wren 09c04aa5de Update and modularize exception handling
cc #1024 #1141

- Stack traces are no longer shown to users unless the --debug flag is
  being used
- Errors, warnings, and other messages contain color as needed
- Converted error messages to Enum
- Adds print_msg function to centralize output (this should replace all
  other output in other modules)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-02-05 16:05:43 -08:00

21 lines
561 B
Python

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.
"""
)