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)))
def getAttribute(attribute, json): return getAttributeFromJSON(attribute, json, "Attribute '{}' missing from JSON".format(attribute))
def getAttribute(attribute, json): return getAttributeFromJSON( attribute, json, "Attribute '{}' missing from JSON".format(attribute))
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)))