Source

django-live / live / features / terrain.py

import subprocess
from time import sleep
from lettuce import *
from selenium import get_driver, FIREFOX


@before.all
def set_browser():
    world.browser = get_driver(FIREFOX)

@before.all
def start_orbited():
    print "starting orbited daemon"
    world.orbited = subprocess.Popen(['orbited', '--config', 'orbited.cfg'])
    sleep(3)
    print "orbited started"

@after.all
def stop_orbited(total):
    world.orbited.terminate()
    print "orbited terminated"

@after.all
def teardown_browser(total):
   world.browser.quit()
   print "Ffirefox terminated"