mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Ensure that line endings in all py files are Linux style instead of Windows (#1250)
This commit is contained in:
parent
6fc252b2c7
commit
e84bb603eb
3 changed files with 54 additions and 54 deletions
|
@ -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.
|
||||
"""
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue