Esempio n. 1
0
def step_impl(context, stream, attribute, length):
    data = context.command[stream]
    assertIsJson(data)

    json = decodeJson(data)
    array = getAttributeFromJSON(attribute, json)
    assertLength(array, int(length))
def step_impl(context, expectedValue):
    print(context.response.json())
    foundValue = getAttributeFromJSON("OK", context.response.json(),
                                      "Attribute not found in response (OK)")
    print(len(set(foundValue)))
    assert (
        len(set(foundValue)) == int(expectedValue)
    ), "For attribute OK, expected different transaction cert of size (%s), instead found (%s)" % (
        expectedValue, len(set(foundValue)))
Esempio n. 3
0
def getAttribute(attribute, json):
    return getAttributeFromJSON(attribute, json,
        "Attribute '{}' missing from JSON".format(attribute))
Esempio n. 4
0
def getAttribute(attribute, json):
    return getAttributeFromJSON(
        attribute, json, "Attribute '{}' missing from JSON".format(attribute))
Esempio n. 5
0
def step_impl(context, expectedValue):
    bdd_log(context.response.json())
    foundValue = getAttributeFromJSON("OK", context.response.json(), "Attribute not found in response (OK)")
    bdd_log(len(set(foundValue)))
    assert (len(set(foundValue)) == int(expectedValue)), "For attribute OK, expected different transaction cert of size (%s), instead found (%s)" % (expectedValue, len(set(foundValue)))