From e84bb603eb66d2dc3e2531ad2b67cb7beba8556f Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 5 Jun 2021 13:15:17 -0700 Subject: [PATCH] Ensure that line endings in all py files are Linux style instead of Windows (#1250) --- tests/test_exception.py | 38 +++++++++++++++++------------------ tests/test_install.py | 26 ++++++++++++------------ tests/test_time.py | 44 ++++++++++++++++++++--------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/tests/test_exception.py b/tests/test_exception.py index 85eb77e9..1fee1982 100644 --- a/tests/test_exception.py +++ b/tests/test_exception.py @@ -1,19 +1,19 @@ -import textwrap - -from jrnl.exception import JrnlError - - -def test_config_directory_exception_message(): - ex = JrnlError( - "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. - """ - ) +import textwrap + +from jrnl.exception import JrnlError + + +def test_config_directory_exception_message(): + ex = JrnlError( + "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. + """ + ) diff --git a/tests/test_install.py b/tests/test_install.py index e24d3b9c..31ec150c 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -1,13 +1,13 @@ -from unittest import mock -import pytest -import sys - - -@pytest.mark.filterwarnings( - "ignore:.*imp module is deprecated.*" -) # ansiwrap spits out an unrelated warning -def test_initialize_autocomplete_runs_without_readline(): - from jrnl import install - - with mock.patch.dict(sys.modules, {"readline": None}): - install._initialize_autocomplete() # should not throw exception +from unittest import mock +import pytest +import sys + + +@pytest.mark.filterwarnings( + "ignore:.*imp module is deprecated.*" +) # ansiwrap spits out an unrelated warning +def test_initialize_autocomplete_runs_without_readline(): + from jrnl import install + + with mock.patch.dict(sys.modules, {"readline": None}): + install._initialize_autocomplete() # should not throw exception diff --git a/tests/test_time.py b/tests/test_time.py index 89f65cb7..c829c52b 100644 --- a/tests/test_time.py +++ b/tests/test_time.py @@ -1,22 +1,22 @@ -import datetime - -from jrnl import time - - -def test_default_hour_is_added(): - assert time.parse( - "2020-06-20", inclusive=False, default_hour=9, default_minute=0, bracketed=False - ) == datetime.datetime(2020, 6, 20, 9) - - -def test_default_minute_is_added(): - assert ( - time.parse( - "2020-06-20", - inclusive=False, - default_hour=0, - default_minute=30, - bracketed=False, - ) - == datetime.datetime(2020, 6, 20, 0, 30) - ) +import datetime + +from jrnl import time + + +def test_default_hour_is_added(): + assert time.parse( + "2020-06-20", inclusive=False, default_hour=9, default_minute=0, bracketed=False + ) == datetime.datetime(2020, 6, 20, 9) + + +def test_default_minute_is_added(): + assert ( + time.parse( + "2020-06-20", + inclusive=False, + default_hour=0, + default_minute=30, + bracketed=False, + ) + == datetime.datetime(2020, 6, 20, 0, 30) + )