steps.py 895 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.processes.stop_process(process_name)
  10. @step('wait for (new )?(\w+) stderr message (\w+)')
  11. def wait_for_message(step, new, process_name, message):
  12. world.processes.wait_for_stderr_str(process_name, [message], new)
  13. @step('wait for (new )?(\w+) stdout message (\w+)')
  14. def wait_for_message(step, process_name, message):
  15. world.processes.wait_for_stdout_str(process_name, [message], new)
  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")