Example #1
0
def step_impl(
    context,
    cur_name,
    new_name,
    new_course,
    new_active,
    new_member_full_name1,
    new_member_full_name2,
    new_member_full_name3,
):
    # nacteni dat skupiny do kontextu
    load_data_to_context(
        context,
        new_name,
        new_course,
        new_active,
        new_member_full_name1,
        new_member_full_name2,
        new_member_full_name3,
    )
    # najdi skupinu
    group_to_update = helpers.find_group_with_name(context.api_client,
                                                   cur_name)
    assert group_to_update
    # uloz puvodni pocet skupin
    save_old_groups_cnt_to_context(context)
    # vlozeni skupiny
    context.resp = context.api_client.put(
        f"{helpers.API_GROUPS}{group_to_update['id']}/", group_dict(context))
Example #2
0
def step_impl(context, name):
    # nacti jmeno skupiny do kontextu
    load_id_data_to_context(context, name)
    # najdi skupinu
    group_to_delete = helpers.find_group_with_name(context.api_client,
                                                   context.name)
    assert group_to_delete
    # uloz puvodni pocet skupin
    save_old_groups_cnt_to_context(context)
    # smazani skupiny
    context.resp = context.api_client.delete(
        f"{helpers.API_GROUPS}{group_to_delete['id']}/")
Example #3
0
def load_data_to_context(context,
                         obj,
                         date,
                         time,
                         duration,
                         canceled,
                         attendances,
                         is_group=False):
    load_id_data_to_context(context, date, time)
    # pro skupinu je potreba ulozit skupinu, pro jednotlivce pouze kurz (klient je v attendances)
    if is_group:
        context.group = helpers.find_group_with_name(context.api_client, obj)
    else:
        context.course = helpers.find_course_with_name(context.api_client, obj)
    context.is_group = is_group
    context.attendances = attendances
    context.duration = duration
    context.canceled = common_helpers.to_bool(canceled)
Example #4
0
def step_impl(context):
    # smazani bylo uspesne
    assert context.resp.status_code == status.HTTP_204_NO_CONTENT
    assert not helpers.find_group_with_name(context.api_client, context.name)
    assert groups_cnt(context.api_client) < context.old_groups_cnt