@given(u'a valid JSON submission "{valid_json}" using "{method}" method')
def step_impl(context, valid_json, method):

    if hasattr(context, 'timeout') is False:
        context.timeout = 5  # Sensible default
    if hasattr(context, 'targeturi') is False:
        assert False, "Target URI not specified"

    # Unserialise into a data structure and store in a list
    # (one valid case is just a special case of providing
    # several valid cases)
    context.submission = [json.loads(valid_json)]
    context.submission_method = method
    context.type = 'json'  # Used downstream to select encoding, etc.
    context.content_type = 'application/json'
    test_valid_submission(context)
    assert True
Outputs the first variable passed that is not False.
dataset/ETHPy150Open F-Secure/mittn/mittn/httpfuzzer/steps.py/step_impl--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/django/template/defaulttags.py/firstof