mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Fix unit test that did not account for new short-circuit when displaying journal with no entries
This commit is contained in:
parent
46b7a64549
commit
8ee1632760
2 changed files with 6 additions and 2 deletions
|
@ -403,7 +403,7 @@ def _change_time_search_results(
|
||||||
|
|
||||||
|
|
||||||
def _display_search_results(args: "Namespace", journal: "Journal", **kwargs) -> None:
|
def _display_search_results(args: "Namespace", journal: "Journal", **kwargs) -> None:
|
||||||
if len(journal.entries) == 0:
|
if len(journal) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get export format from config file if not provided at the command line
|
# Get export format from config file if not provided at the command line
|
||||||
|
|
|
@ -20,7 +20,11 @@ def random_string():
|
||||||
@pytest.mark.parametrize("export_format", ["pretty", "short"])
|
@pytest.mark.parametrize("export_format", ["pretty", "short"])
|
||||||
def test_display_search_results_pretty_short(export_format):
|
def test_display_search_results_pretty_short(export_format):
|
||||||
mock_args = parse_args(["--format", export_format])
|
mock_args = parse_args(["--format", export_format])
|
||||||
test_journal = mock.Mock(wraps=jrnl.journals.Journal('default'))
|
|
||||||
|
test_journal = jrnl.journals.Journal()
|
||||||
|
test_journal.new_entry("asdf")
|
||||||
|
|
||||||
|
test_journal.pprint = mock.Mock()
|
||||||
|
|
||||||
_display_search_results(mock_args, test_journal)
|
_display_search_results(mock_args, test_journal)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue