steps.py 624 B

12345678910111213141516171819202122232425
  1. from lettuce import *
  2. import subprocess
  3. import os.path
  4. @before.each_scenario
  5. def initialize(feature):
  6. # just make sure our cleanup won't fail if we never did
  7. # run the bind10 instance
  8. world.bind10 = None
  9. world.bind10_output = []
  10. @after.each_scenario
  11. def cleanup(feature):
  12. world.shutdown_server()
  13. world.bind10_output = []
  14. @step(u'Given I have no database')
  15. def given_i_have_no_database(step):
  16. if os.path.exists("test.db"):
  17. os.remove("test.db")
  18. @step(u'I should see a database file')
  19. def i_should_see_a_database_file(step):
  20. assert os.path.exists("test.db")
  21. os.remove("test.db")