Example #1
0
def app_ctx(cfg):
    namespace_mapping, backend_mapping, acl_mapping = create_simple_mapping(
        "stores:memory:",
        cfg.default_acl
    )
    more_config = dict(
        namespace_mapping=namespace_mapping,
        backend_mapping=backend_mapping,
        acl_mapping=acl_mapping,
        create_storage=True,  # create a fresh storage at each app start
        destroy_storage=True,  # kill all storage contents at app shutdown
        create_index=True,  # create a fresh index at each app start
        destroy_index=True,  # kill index contents at app shutdown
    )
    app = create_app_ext(
        flask_config_dict=dict(SECRET_KEY='foobarfoobar'),
        moin_config_class=cfg,
        **more_config
    )
    ctx = app.test_request_context('/', base_url="http://localhost:8080/")
    ctx.push()
    before_wiki()

    yield app, ctx

    teardown_wiki('')
    ctx.pop()
    destroy_app(app)
Example #2
0
def app_ctx(cfg):
    namespace_mapping, backend_mapping, acl_mapping = create_simple_mapping(
        "stores:memory:", cfg.default_acl)
    more_config = dict(
        namespace_mapping=namespace_mapping,
        backend_mapping=backend_mapping,
        acl_mapping=acl_mapping,
        create_storage=True,  # create a fresh storage at each app start
        destroy_storage=True,  # kill all storage contents at app shutdown
        create_index=True,  # create a fresh index at each app start
        destroy_index=True,  # kill index contents at app shutdown
    )
    app = create_app_ext(flask_config_dict=dict(SECRET_KEY='foobarfoobar'),
                         moin_config_class=cfg,
                         **more_config)
    ctx = app.test_request_context('/', base_url="http://localhost:8080/")
    ctx.push()
    before_wiki()

    yield app, ctx

    teardown_wiki('')
    ctx.pop()
    destroy_app(app)
Example #3
0
def deinit_test_app(app, ctx):
    teardown_wiki('')
    ctx.pop()
    destroy_app(app)