Exemplo n.º 1
0
async def test_status():
    context = await Context.create_with_config(await get_test_config())
    update_configs = UpdateConfigs()
    msg = update_configs.status_msg(context)

    assert msg['@type'] == '{};spec/{}/{}/{}'.format(
        EVERNYM_MSG_QUALIFIER, UpdateConfigs.MSG_FAMILY,
        UpdateConfigs.MSG_FAMILY_VERSION, UpdateConfigs.GET_STATUS)
    assert msg['@id'] is not None

    await cleanup(context)
Exemplo n.º 2
0
async def test_update():
    context = await Context.create_with_config(await get_test_config())
    update_configs = UpdateConfigs(name, logo_url)
    msg = update_configs.update_msg(context)

    assert msg['@type'] == '{};spec/{}/{}/{}'.format(
        EVERNYM_MSG_QUALIFIER, UpdateConfigs.MSG_FAMILY,
        UpdateConfigs.MSG_FAMILY_VERSION, UpdateConfigs.UPDATE_CONFIGS)
    assert msg['@id'] is not None
    assert msg['configs'] == [{
        'name': 'name',
        'value': name
    }, {
        'name': 'logoUrl',
        'value': logo_url
    }]

    await cleanup(context)
async def update_configs():
    handlers.add_handler('update-configs', '0.6', noop)
    configs = UpdateConfigs(INSTITUTION_NAME, LOGO_URL)
    await configs.update(context)
Exemplo n.º 4
0
def test_init():
    update_configs = UpdateConfigs(name, logo_url)

    assert update_configs.name == name
    assert update_configs.logo_url == logo_url