liveandletdie 0.0.2

Live and Let Die (former Test Live Server) is a simple package to simplify launching and
terminating of web development servers from BDD or functional tests.
I have created it for functional testing of the
Authomatic package.

Note that the package has just recently been renamed from former testliveserver
to current liveandletdie!

The package Currently supports Google App engine, Django,
Flask and wsgiref.simple_server. Support for other frameworks will
hopefully be added in future.

Google App Engine

Flask

By Flask you must wrap the WSGI application in
liveandletdie.Flask.wrap(app).

# flask/app/main.pyfromflaskimportFlaskDEBUG=TrueSECRET_KEY='development key'USERNAME='admin'PASSWORD='default'app=Flask(__name__)app.config.from_object(__name__)@app.route('/')defhome():return'Hello World!'if__name__=='__main__':# This does nothing unless you run this module with --liveandletdie flag.importliveandletdieliveandletdie.Flask.wrap(app)app.run()

Pyramid (wsgiref.simple_server)

By wsgiref.simple_server you must wrap the WSGI application in
liveandletdie.WsgirefSimpleServer.wrap(app).

# pyramid/app/main.pyfromwsgiref.simple_serverimportmake_serverfrompyramid.configimportConfiguratorfrompyramid.responseimportResponsedefhome(request):returnResponse('Hello World!')if__name__=='__main__':config=Configurator()config.add_route('home','/')config.add_view(home,route_name='home')app=config.make_wsgi_app()# This does nothing unless you run this module with --liveandletdie flag.importliveandletdieliveandletdie.WsgirefSimpleServer.wrap(app)server=make_server('127.0.0.1',8080,app)server.serve_forever()