Exemple #1
0
def _add_skills(context):
    foo_skill, foo_settings_display = add_skill(
        context.db,
        skill_global_id='foo-skill|19.02',
    )
    bar_skill, bar_settings_display = add_skill(
        context.db,
        skill_global_id='bar-skill|19.02',
        settings_fields=[build_label_field(),
                         build_text_field()])
    context.skills = dict(foo=(foo_skill, foo_settings_display),
                          bar=(bar_skill, bar_settings_display))
Exemple #2
0
def _add_device_specific_skill(context):
    dirty_skill, dirty_skill_settings = add_skill(
        context.db,
        skill_global_id='@{device_id}|device-specific-skill|19.02'.format(
            device_id=context.device_id))
    context.skills.update(dirty=(dirty_skill, dirty_skill_settings))
    context.device_specific_manifest = add_device_skill(
        context.db, context.device_id, dirty_skill)
Exemple #3
0
def _add_skills(context):
    """Add skill objects to the context for use in step code."""
    foo_skill, foo_settings_display = add_skill(
        context.db,
        skill_global_id="foo-skill|19.02",
    )
    bar_skill, bar_settings_display = add_skill(
        context.db,
        skill_global_id="bar-skill|19.02",
        settings_fields=[
            build_label_field(),
            build_text_field(),
            build_checkbox_field(),
        ],
    )
    context.skills = dict(foo=(foo_skill, foo_settings_display),
                          bar=(bar_skill, bar_settings_display))
Exemple #4
0
def add_skill_not_assigned_to_device(context):
    foobar_skill, foobar_settings_display = add_skill(
        context.db,
        skill_global_id='foobar-skill|19.02',
        settings_fields=[build_label_field(), build_text_field()]
    )
    section = foobar_settings_display.display_data['skillMetadata']['sections'][0]
    field_with_value = section['fields'][1]
    field_with_value['value'] = 'New skill text value'
    context.skills.update(foobar=(foobar_skill, foobar_settings_display))
Exemple #5
0
def _add_device_specific_skill(context):
    """Add a skill with a device specific skill GID."""
    dirty_skill, dirty_skill_settings = add_skill(
        context.db,
        skill_global_id="@{device_id}|device-specific-skill|19.02".format(
            device_id=context.device_id),
    )
    context.skills.update(dirty=(dirty_skill, dirty_skill_settings))
    context.device_specific_skill = add_device_skill(context.db,
                                                     context.device_id,
                                                     dirty_skill)