示例#1
0
async def _(app: Kutana):
    for backend in app.get_backends():
        if backend.get_identity() == 'vkontakte':
            app.config['owner_id'] = (await backend.resolve_screen_name(
                app.config['settings']['OWNER_ID']))['object_id']
            await init_db(app)
            # order is important
            await init_scheduler(app)
            break
示例#2
0
def test_same_plugins_and_backends():
    app = Kutana()

    plugin = Plugin("")
    backend = Debug([])

    app.add_plugin(plugin)
    with pytest.raises(RuntimeError):
        app.add_plugin(plugin)

    app.add_backend(backend)
    with pytest.raises(RuntimeError):
        app.add_backend(backend)

    assert app.get_backends() == [backend]