コード例 #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))
コード例 #2
0
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)))
コード例 #3
0
ファイル: peer_cli_impl.py プロジェクト: 0yukikaze0/fabric
def getAttribute(attribute, json):
    return getAttributeFromJSON(attribute, json,
        "Attribute '{}' missing from JSON".format(attribute))
コード例 #4
0
ファイル: peer_cli_impl.py プロジェクト: jeremyeder/fabric
def getAttribute(attribute, json):
    return getAttributeFromJSON(
        attribute, json, "Attribute '{}' missing from JSON".format(attribute))
コード例 #5
0
ファイル: peer_rest_impl.py プロジェクト: jeremyeder/fabric
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)))