steps.py 868 B

1234567891011121314151617181920212223242526272829
  1. #
  2. # This file contains a number of common steps that are general and may be used
  3. # By a lot of feature files.
  4. #
  5. from lettuce import *
  6. import os
  7. @step('stop process (\w+)')
  8. def stop_a_named_process(step, process_name):
  9. world.stop_process(process_name)
  10. @step('wait for (\w+) stderr message (\w+)')
  11. def wait_for_message(step, process_name, message):
  12. world.wait_for_output_lines_stderr(process_name, [message], False)
  13. @step('wait for (\w+) stdout message (\w+)')
  14. def wait_for_message(step, process_name, message):
  15. world.wait_for_output_lines_stdout(process_name, [message], False)
  16. @step('Given I have no database')
  17. def given_i_have_no_database(step):
  18. if os.path.exists("test.db"):
  19. os.remove("test.db")
  20. @step('I should see a database file')
  21. def i_should_see_a_database_file(step):
  22. assert os.path.exists("test.db")
  23. os.remove("test.db")