Check message on stderr and patch subprocess.call

This commit is contained in:
Aaron Lichtman 2019-11-16 13:18:14 +01:00
parent c0a1c171f1
commit ccb55392dd
No known key found for this signature in database
GPG key ID: 22368077DE9F9903
2 changed files with 7 additions and 5 deletions

View file

@ -67,9 +67,11 @@ def set_config(context, config_file):
cf.write("version: {}".format(__version__))
@when('we open the editor and exit')
def open_editor_and_exit_without_entering_text(context):
with patch('jrnl.util.get_text_from_editor', return_value=""):
@when('we open the editor and enter')
@when('we open the editor and enter {text}')
def open_editor_and_enter(context, text=""):
text = (text or context.text)
with patch('subprocess.call', return_value=text):
run(context, "jrnl")