def create_test_app():
    from genesis_block_explorer.app import create_lean_app as create_app
    app = create_app()
    app.app_context().push()
    #update_aux_db_engine_discovery_map(app, force_update=True,
    #                                   aux_db_engine_name_prefix='test_aux_')
    return app
def test_add_prefix_to_param_str_value():
    app = create_app()
    param = mk_randword(8, up=True) + '_STR'
    assert param not in app.config
    src_value = mk_randword(8)
    app.config[param] = src_value
    prefix = mk_randword(4) + '_'
    AppConfig(app).add_prefix_to_param_str_value(param, prefix)
    assert param in app.config
    assert app.config.get(param) == prefix + src_value
def test_app_config_add_prefix_to_param_dict_keys():
    app = create_app()
    param = mk_randword(8, up=True) + '_DICT'
    assert param not in app.config
    src_dict = {mk_randword(4): mk_randword(6, up=True) for a in range(1, 5)}
    app.config[param] = src_dict.copy()
    prefix = mk_randword(4) + '_'
    AppConfig(app).add_prefix_to_param_dict_keys(param, prefix)
    assert param in app.config
    for k, v in src_dict.items():
        assert prefix + k in app.config.get(param)
Exemplo n.º 4
0
#! /usr/bin/env python

from genesis_block_explorer.app import create_app

app = create_app(debug=True)
app.app_context().push()

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80, debug=True)
Exemplo n.º 5
0
#! /usr/bin/env python

from genesis_block_explorer.app import create_app
app = create_app()
app.app_context().push()
app.run(host='127.0.0.1', debug=False)
Exemplo n.º 6
0
def create_test_app():
    from genesis_block_explorer.app import create_lean_app as create_app
    app = create_app()
    app.app_context().push()
    return app