Ejemplo n.º 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)
Ejemplo n.º 2
0
def init_test_app(given_config):
    namespace_mapping, router_index_uri = create_simple_mapping(
        "memory:", given_config.content_acl)
    more_config = dict(
        namespace_mapping=namespace_mapping,
        router_index_uri=router_index_uri,
    )
    app = create_app_ext(flask_config_dict=dict(SECRET_KEY='foobarfoobar'),
                         moin_config_class=given_config,
                         **more_config)
    ctx = app.test_request_context('/')
    ctx.push()
    before_wiki()
    return app, ctx
Ejemplo n.º 3
0
def init_test_app(given_config):
    namespace_mapping, acl_mapping = create_simple_mapping("stores:memory:", given_config.content_acl)
    more_config = dict(
        namespace_mapping=namespace_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=given_config,
                         **more_config)
    ctx = app.test_request_context('/', base_url="http://localhost:8080/")
    ctx.push()
    before_wiki()
    return app, ctx
Ejemplo n.º 4
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)