mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 13:08:31 +02:00
Fix test?
This commit is contained in:
parent
c23efa7f80
commit
bca12b4b16
1 changed files with 5 additions and 2 deletions
|
@ -67,7 +67,7 @@ def set_config(context, config_file):
|
||||||
cf.write("version: {}".format(__version__))
|
cf.write("version: {}".format(__version__))
|
||||||
|
|
||||||
|
|
||||||
@when('we open the editor and enter nothing')
|
@when('we open the editor and enter ""')
|
||||||
@when('we open the editor and enter "{text}"')
|
@when('we open the editor and enter "{text}"')
|
||||||
def open_editor_and_enter(context, text=""):
|
def open_editor_and_enter(context, text=""):
|
||||||
text = (text or context.text)
|
text = (text or context.text)
|
||||||
|
@ -77,7 +77,10 @@ def open_editor_and_enter(context, text=""):
|
||||||
tmpfile = command[-1]
|
tmpfile = command[-1]
|
||||||
print("TMPFILE:", tmpfile)
|
print("TMPFILE:", tmpfile)
|
||||||
with open(tmpfile, "w+") as f:
|
with open(tmpfile, "w+") as f:
|
||||||
f.write(text)
|
if text is not None:
|
||||||
|
f.write(text)
|
||||||
|
else:
|
||||||
|
f.write("")
|
||||||
|
|
||||||
print("File contents:", open(tmpfile, "r").read())
|
print("File contents:", open(tmpfile, "r").read())
|
||||||
return tmpfile
|
return tmpfile
|
||||||
|
|
Loading…
Add table
Reference in a new issue