steps.py 895 Bytes
Newer Older
1
2
3
4
5
#
# This file contains a number of common steps that are general and may be used
# By a lot of feature files.
#

Jelte Jansen's avatar
Jelte Jansen committed
6
from lettuce import *
7
import os
Jelte Jansen's avatar
Jelte Jansen committed
8

9
10
@step('stop process (\w+)')
def stop_a_named_process(step, process_name):
11
    world.processes.stop_process(process_name)
12

13
14
@step('wait for (new )?(\w+) stderr message (\w+)')
def wait_for_message(step, new, process_name, message):
15
    world.processes.wait_for_stderr_str(process_name, [message], new)
16

17
@step('wait for (new )?(\w+) stdout message (\w+)')
18
def wait_for_message(step, process_name, message):
19
    world.processes.wait_for_stdout_str(process_name, [message], new)
20

21
@step('Given I have no database')
Jelte Jansen's avatar
Jelte Jansen committed
22
def given_i_have_no_database(step):
23
24
    if os.path.exists("test.db"):
        os.remove("test.db")
Jelte Jansen's avatar
Jelte Jansen committed
25

26
@step('I should see a database file')
Jelte Jansen's avatar
Jelte Jansen committed
27
28
29
def i_should_see_a_database_file(step):
    assert os.path.exists("test.db")
    os.remove("test.db")