mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 07:16:12 +02:00
Merge branch 'develop' of https://github.com/Briscoooe/jrnl into develop
This commit is contained in:
commit
02f8246b49
29 changed files with 131 additions and 112 deletions
|
@ -144,7 +144,7 @@ def mock_overrides(config_in_memory):
|
|||
|
||||
return {
|
||||
"overrides": lambda: patch(
|
||||
"jrnl.jrnl.apply_overrides", side_effect=my_overrides
|
||||
"jrnl.controller.apply_overrides", side_effect=my_overrides
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from pytest_bdd import when
|
|||
from pytest_bdd.parsers import parse
|
||||
from pytest_bdd.parsers import re
|
||||
|
||||
from jrnl.cli import cli
|
||||
from jrnl.main import run
|
||||
|
||||
|
||||
@when(parse('we change directory to "{directory_name}"'))
|
||||
|
@ -44,7 +44,7 @@ def we_run_jrnl(cli_run, capsys, keyring):
|
|||
mocks[id] = stack.enter_context(factories[id]())
|
||||
|
||||
try:
|
||||
cli_run["status"] = cli() or 0
|
||||
cli_run["status"] = run() or 0
|
||||
except StopIteration:
|
||||
# This happens when input is expected, but don't have any input left
|
||||
pass
|
||||
|
|
|
@ -9,7 +9,7 @@ import pytest
|
|||
|
||||
import jrnl
|
||||
from jrnl.args import parse_args
|
||||
from jrnl.jrnl import _display_search_results
|
||||
from jrnl.controller import _display_search_results
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -19,10 +19,10 @@ def random_string():
|
|||
|
||||
@pytest.mark.parametrize("export_format", ["pretty", "short"])
|
||||
@mock.patch("builtins.print")
|
||||
@mock.patch("jrnl.Journal.Journal.pprint")
|
||||
@mock.patch("jrnl.controller.Journal.pprint")
|
||||
def test_display_search_results_pretty_short(mock_pprint, mock_print, export_format):
|
||||
mock_args = parse_args(["--format", export_format])
|
||||
test_journal = mock.Mock(wraps=jrnl.Journal.Journal)
|
||||
test_journal = mock.Mock(wraps=jrnl.journals.Journal)
|
||||
|
||||
_display_search_results(mock_args, test_journal)
|
||||
|
||||
|
@ -40,7 +40,7 @@ def test_display_search_results_builtin_plugins(
|
|||
test_filename = random_string
|
||||
mock_args = parse_args(["--format", export_format, "--file", test_filename])
|
||||
|
||||
test_journal = mock.Mock(wraps=jrnl.Journal.Journal)
|
||||
test_journal = mock.Mock(wraps=jrnl.journals.Journal)
|
||||
mock_export = mock.Mock()
|
||||
mock_exporter.return_value.export = mock_export
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue