How to use the behave.when function in behave

To help you get started, we’ve selected a few behave examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thelastpickle / cassandra-medusa / tests / integration / features / steps / integration_steps.py View on Github external
@when(r'I restore the backup named "{backup_name}" for "{fqtn}" table')
def _i_restore_the_backup_named_for_table(context, backup_name, fqtn):
    medusa.restore_node.restore_node(
        context.medusa_config,
        Path("/tmp"),
        backup_name,
        in_place=True,
        keep_auth=False,
        seeds=None,
        verify=None,
        keyspaces={},
        tables={fqtn},
        use_sstableloader=False,
    )
github algorand / py-algorand-sdk / test / steps / steps.py View on Github external
@when("I get the suggested params")
def suggested_params(context):
    context.params = context.acl.suggested_params_as_object()
github coala / coala-vs-code / tests / server.features / steps / langserver_steps.py View on Github external
@when('I invoke send_diagnostics message')
def step_impl(context):
    context.langServer.send_diagnostics('/sample', [])
    context._diagCount = 0
github algorand / py-algorand-sdk / test / steps / v2_steps.py View on Github external
@when("we make any LookupAccountByID call")
def lookup_account_any(context):
    context.response = context.icl.account_info("PNWOET7LLOWMBMLE4KOCELCX6X3D3Q4H2Q4QJASYIEOF7YIPPQBG3YQ5YI", 12)
github Yelp / paasta / paasta_itests / steps / chronos_steps.py View on Github external
@when('we wait for the chronos job stored as "{job_name}" to appear in the job list')
def chronos_job_is_ready(context, job_name):
    """Wait for a job with a matching job id to be ready."""
    chronos_tools.wait_for_job(context.chronos_client, context.jobs[job_name]["name"])
github alexcouper / captainhook / features / steps / git_steps.py View on Github external
@when('I attempt to commit')
def commit(context):
    context.last_command = bash('git commit -q -m "commit"')
github sparkslabs / guild / features / steps / actor_feature_steps.py View on Github external
@when(u'we create an instance of that class')
def step_impl(context):
    klass = context.klass
    context.value = klass(1,2,3)
github codeforamerica / intake / features / steps / applications_steps.py View on Github external
@when("I click on the applicant's row")
def click_row(context):
    selector = application_row_selector.format(SEARCHABLE_APPLICANT_ID)
    selector += ' > td:first-child > a'
    element = context.browser.find_element_by_css_selector(selector)
    element.click()
github scanny / python-pptx / features / steps / text.py View on Github external
@when("I assign paragraph.alignment = PP_ALIGN.CENTER")
def when_I_assign_paragraph_alignment_eq_center(context):
    context.paragraph.alignment = PP_ALIGN.CENTER
github python-openxml / python-docx / features / steps / parfmt.py View on Github external
@when('I assign {value} to paragraph_format.line_spacing')
def when_I_assign_value_to_paragraph_format_line_spacing(context, value):
    new_value = {
        'Pt(14)': Pt(14),
        '2':      2,
    }.get(value)
    new_value = float(value) if new_value is None else new_value
    context.paragraph_format.line_spacing = new_value