Tests for writing entries from the command line

This commit is contained in:
Manuel Ebert 2013-07-19 11:36:39 +02:00
parent cd67ad73ea
commit af16165159
2 changed files with 16 additions and 3 deletions

View file

@ -2,7 +2,7 @@ from behave import *
from jrnl import Journal, jrnl
import os
@given('we use "{config_file}"')
@given('we use the config "{config_file}"')
def set_config(context, config_file):
full_path = os.path.join("features/configs", config_file)
jrnl.CONFIG_PATH = os.path.abspath(full_path)
@ -22,3 +22,9 @@ def check_output(context):
out = context.stdout_capture.getvalue().strip().splitlines()
for line_text, line_out in zip(text, out):
assert line_text.strip() == line_out.strip()
@then('the output should contain "{text}"')
def check_output(context, text):
out = context.stdout_capture.getvalue()
print out
assert text in out