Exemplo n.º 1
0
def getFileLines(path):
    filePath = SovrinCli._getFilePath(path)
    with open(filePath, 'r') as fin:
        lines = fin.readlines()
    alteredLines = []
    for line in lines:
        alteredLines.append(line.replace('{', '{{').replace('}', '}}'))
    return alteredLines
Exemplo n.º 2
0
def main():
    base_dir = config.baseDir
    if not os.path.exists(base_dir):
        os.makedirs(base_dir)
    loadPlugins(base_dir)

    pool = create_local_pool(base_dir)

    demo_start_agents(pool, pool, pool.base_dir)

    curDir = os.getcwd()
    logFilePath = os.path.join(curDir, config.logFilePath)

    cli = SovrinCli(looper=pool,
                    basedirpath=pool.base_dir,
                    logFileName=logFilePath,
                    withNode=False)

    pool.run(cli.shell())
def test_showProofOnlyUsedAttributesAreHighlighted(claimsUsedForProof,
                                                   proofRequestAttrs):
    actualConstructionToPrint = SovrinCli._printClaimsUsedInProofConstruction(
        claimsUsedForProof, proofRequestAttrs)

    expectedPrint = '\nThe Proof is constructed from the following claims:\n' \
                    '\n    Claim [1] (TestClaim-1 v0.1 from Issuer 1)\n' \
                    '        * first_name: Alice\n' \
                    '        * last_name: Garcia\n' \
                    '          account_address_1: 321\n' \
                    '          date_of_birth: May 15, 1990\n' \
                    '\n    Claim [2] (TestClaim-2 v0.1 from Issuer 2)\n' \
                    '          first_name: Alice\n' \
                    '          last_name: Garcia\n' \
                    '        * account_status: active\n'

    assert expectedPrint == actualConstructionToPrint
def test_showProofOnlyUsedAttributesAreHighlighted(
        claimsUsedForProof, proofRequestAttrs):
    actualConstructionToPrint = SovrinCli._printClaimsUsedInProofConstruction(
        claimsUsedForProof, proofRequestAttrs
    )

    expectedPrint = '\nThe Proof is constructed from the following claims:\n' \
                    '\n    Claim [1] (TestClaim-1 v0.1 from Issuer 1)\n' \
                    '        * first_name: Alice\n' \
                    '        * last_name: Garcia\n' \
                    '          account_address_1: 321\n' \
                    '          date_of_birth: May 15, 1990\n' \
                    '\n    Claim [2] (TestClaim-2 v0.1 from Issuer 2)\n' \
                    '          first_name: Alice\n' \
                    '          last_name: Garcia\n' \
                    '        * account_status: active\n'

    assert expectedPrint == actualConstructionToPrint
Exemplo n.º 5
0
def getFileLines(path, caller_file=None):
    filePath = SovrinCli._getFilePath(path, caller_file)
    with open(filePath, 'r') as fin:
        lines = fin.read().splitlines()
    return lines
Exemplo n.º 6
0
def getFileLines(path, caller_file=None):
    filePath = SovrinCli._getFilePath(path, caller_file)
    with open(filePath, 'r') as fin:
        lines = fin.read().splitlines()
    return lines