def test_get_task_action(context, scopes, expected, raises):
    context.task['scopes'] = [scopes]
    if raises:
        with pytest.raises(ScriptWorkerTaskException):
            get_task_action(context)
    else:
        assert expected == get_task_action(context)
Ejemplo n.º 2
0
async def async_main(context):
    validate_task_schema(context)

    context.ship_it_instance_config = get_ship_it_instance_config_from_scope(context)
    context.action = get_task_action(context)

    # action has already been validated
    ACTION_MAP[context.action](context)
    log.info('Success!')