mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
add test to repro issue #955
This commit is contained in:
parent
f86d923843
commit
6f7c538cb1
3 changed files with 13 additions and 1 deletions
|
@ -4,6 +4,7 @@ editor: ''
|
|||
template: false
|
||||
encrypt: false
|
||||
highlight: true
|
||||
editor: noop
|
||||
journals:
|
||||
default: features/journals/dayone.dayone
|
||||
linewrap: 80
|
||||
|
|
|
@ -75,3 +75,9 @@ Feature: Dayone specific implementation details.
|
|||
and the json output should contain entries.0.creator.generation_date
|
||||
and the json output should contain entries.0.creator.device_agent
|
||||
and "entries.0.creator.software_agent" in the json output should contain "jrnl"
|
||||
|
||||
Scenario: Editing Dayone with mock editor
|
||||
Given we use the config "dayone.yaml"
|
||||
When we run "jrnl --edit"
|
||||
Then we should get no error
|
||||
|
||||
|
|
|
@ -209,8 +209,13 @@ def run(context, command, cache_dir=None):
|
|||
|
||||
args = ushlex(command)
|
||||
|
||||
def _mock_editor(command):
|
||||
context.editor_command = command
|
||||
|
||||
try:
|
||||
with patch("sys.argv", args):
|
||||
with patch("sys.argv", args), patch(
|
||||
"subprocess.call", side_effect=_mock_editor
|
||||
):
|
||||
cli.run(args[1:])
|
||||
context.exit_status = 0
|
||||
except SystemExit as e:
|
||||
|
|
Loading…
Add table
Reference in a new issue