mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-02 06:56:12 +02:00
Clean up controller
- streamline `run` function in `controller.py` - add debug logging - fix unnecessary import of Journal class (only needed for typing) - standardize summary display across different actions
This commit is contained in:
parent
bade98ef0d
commit
c182395fce
2 changed files with 47 additions and 40 deletions
|
@ -18,15 +18,13 @@ def random_string():
|
|||
|
||||
|
||||
@pytest.mark.parametrize("export_format", ["pretty", "short"])
|
||||
@mock.patch("builtins.print")
|
||||
@mock.patch("jrnl.controller.Journal.pprint")
|
||||
def test_display_search_results_pretty_short(mock_pprint, mock_print, export_format):
|
||||
def test_display_search_results_pretty_short(export_format):
|
||||
mock_args = parse_args(["--format", export_format])
|
||||
test_journal = mock.Mock(wraps=jrnl.journals.Journal)
|
||||
test_journal = mock.Mock(wraps=jrnl.journals.Journal('default'))
|
||||
|
||||
_display_search_results(mock_args, test_journal)
|
||||
|
||||
mock_print.assert_called_once_with(mock_pprint.return_value)
|
||||
test_journal.pprint.assert_called_once()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue