예제 #1
0
    def setUp(self):
        coord_address = CoordAddress.translate(
                "server0:instance0@machine0")

        self.cfg_manager = ConfigurationManager.ConfigurationManager()
        self.cfg_manager.append_module(configuration_module)

        self.core_server = UserProcessingServer(coord_address, None, self.cfg_manager)
예제 #2
0
#############################################
# 
# The code below is only used for testing
# 

if __name__ == '__main__':
    from voodoo.configuration import ConfigurationManager
    from weblab.core.server import UserProcessingServer
    from weblab.core.i18n import initialize_i18n
    from flask_debugtoolbar import DebugToolbarExtension

    cfg_manager = ConfigurationManager()
    cfg_manager.append_path('test/unit/configuration.py')

    ups = UserProcessingServer(None, None, cfg_manager, dont_start = True)

    app = Flask('weblab.core.server')
    app.config['SECRET_KEY'] = os.urandom(32)
    app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
    app.config['DEBUG'] = True

    @app.route("/site-map")
    def site_map():
        lines = []
        for rule in app.url_map.iter_rules():
            line = str(escape(repr(rule)))
            lines.append(line)

        ret = "<br>".join(lines)
        return ret