Commit dd7fb442 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[1290] allow examination of past b10 output

parent 032f9633
......@@ -8,12 +8,24 @@ def shutdown_server():
world.bind10.wait()
world.bind10 = None
def check_lines(output, lines):
for line in lines:
if output.find(line) != -1:
return line
@world.absorb
def wait_for_output_lines(lines):
def wait_for_output_lines(lines, examine_past = True):
assert world.bind10 is not None
if examine_past:
for output in world.bind10_output:
for line in lines:
if output.find(line) != -1:
return line
found = False
while not found:
output = world.bind10.stderr.readline()
# store any line, for examine_skipped
world.bind10_output.append(output)
for line in lines:
if output.find(line) != -1:
return line
......
......@@ -7,14 +7,17 @@ def initialize(feature):
# just make sure our cleanup won't fail if we never did
# run the bind10 instance
world.bind10 = None
world.bind10_output = []
@after.each_scenario
def cleanup(feature):
world.shutdown_server()
world.bind10_output = []
@step(u'Given I have no database')
def given_i_have_no_database(step):
assert not os.path.exists("test.db")
if os.path.exists("test.db"):
os.remove("test.db")
@step(u'I should see a database file')
def i_should_see_a_database_file(step):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment