Example #1
0
def step_impl(context):
    response = context.response
    json = get_json(response)

    assert response.status_code == 200
    assert json['success'] is True
    assert json['data']['name'] == 'Soccer'
Example #2
0
def step_impl(context):
    response = context.response
    json = get_json(response)

    assert len(json['data']) == 2
    assert json['data'][0]['slug'] == 'item-3'
    assert json['data'][1]['slug'] == 'item-2'
Example #3
0
def after_scenario(context, scenario):
    # Remove all items

    response = context.client.get('/items')
    json = get_json(response)

    ids = [item['id'] for item in json['data']]

    responses = remove_items(ids, client=context.client)

    for response in responses:
        assert response.status_code == 200
Example #4
0
def step_impl(context):
    response = context.response
    json = get_json(response)

    assert json['success'] is True
    assert len(json['data']) == 9
Example #5
0
def step_impl(context):
    response = context.response
    json = get_json(response)

    assert json['data']['slug'] == 'item-1'
    assert json['data']['category']['id'] == 1