view piecrust/wsgiutil/__init__.py @ 391:3e4bb57d8506

tests: Add support for testing the Chef server. * Make the server be functional without calling `getWsgiApp`. * Add new type of test files that use a Werkzeug test client.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 17 May 2015 10:48:41 -0700
parents d40b744a9d99
children cc6f3dbe3048
line wrap: on
line source

from piecrust.serving.server import Server


def get_app(root_dir, sub_cache_dir='prod', enable_debug_info=False):
    server = Server(root_dir,
                    sub_cache_dir=sub_cache_dir,
                    enable_debug_info=enable_debug_info)
    app = server.getWsgiApp()
    return app