예제 #1
0
def alice_disconnected(alice, be, do, alice_connected):
    be(alice)
    do(None, expect=prompt_is("sovrin@test"))
    do('disconnect',
       within=1,
       expect=['Disconnecting from test ...', 'Disconnected from test'])
    do(None, expect=prompt_is("sovrin"))
예제 #2
0
def alice_disconnected(alice, be, do, alice_connected):
    be(alice)
    do(None, expect=prompt_is("sovrin@test"))
    do('disconnect', within=1, expect=[
        'Disconnecting from test ...',
        'Disconnected from test'
    ])
    do(None, expect=prompt_is("sovrin"))
예제 #3
0
def test_connect_to_different_pools(do, be, cliForMultiNodePools):
    be(cliForMultiNodePools)
    do(None, expect=prompt_is("sovrin"))
    do('connect pool1', within=5, expect=["Connected to pool1"])
    do(None, expect=prompt_is("sovrin@pool1"))
    do('connect pool2', within=5, expect=["Connected to pool2"])
    do(None, expect=prompt_is("sovrin@pool2"))
    do('connect pool1', within=5, expect=["Connected to pool1"])
    do(None, expect=prompt_is("sovrin@pool1"))
예제 #4
0
def test_connect_to_different_pools(do, be, cliForMultiNodePools):
    be(cliForMultiNodePools)
    do(None, expect=prompt_is("sovrin"))
    do('connect pool1', within=5, expect=["Connected to pool1"])
    do(None, expect=prompt_is("sovrin@pool1"))
    do('connect pool2', within=5, expect=["Connected to pool2"])
    do(None, expect=prompt_is("sovrin@pool2"))
    do('connect pool1', within=5, expect=["Connected to pool1"])
    do(None, expect=prompt_is("sovrin@pool1"))
예제 #5
0
def testDisconnect(do, be, poolNodesCreated, aliceCli):
    be(aliceCli)
    do(None, expect=prompt_is("sovrin"))
    do('disconnect', within=1, expect=['Not connected to any environment.'])
    do(None, expect=prompt_is("sovrin"))
    do('connect test', within=5, expect=["Connected to test"])
    do(None, expect=prompt_is("sovrin@test"))
    do('disconnect', within=1, expect=[
        'Disconnecting from test ...',
        'Disconnected from test'
    ])
    do(None, expect=prompt_is("sovrin"))
예제 #6
0
def trustAnchorCli(be, do, poolNodesStarted, earlCLI, connectedToTest,
               trustAnchorWallet):
    be(earlCLI)
    do('prompt Earl', expect=prompt_is('Earl'))
    addAndActivateCLIWallet(earlCLI, trustAnchorWallet)
    do('connect test', within=3, expect=connectedToTest)
    return earlCLI
예제 #7
0
def trustAnchorCli(be, do, poolNodesStarted, earlCLI, connectedToTest,
                   trustAnchorWallet):
    be(earlCLI)
    do('prompt Earl', expect=prompt_is('Earl'))
    addAndActivateCLIWallet(earlCLI, trustAnchorWallet)
    do('connect test', within=3, expect=connectedToTest)
    return earlCLI
예제 #8
0
def philCli(be, do, philCLI, trusteeCli):

    be(philCLI)

    do('prompt Phil', expect=prompt_is('Phil'))

    do('new keyring Phil', expect=['New keyring Phil created',
                                   'Active keyring set to "Phil"'])
    phil_seed = '11111111111111111111111111111111'
    phil_signer = DidSigner(seed=phil_seed.encode())

    mapper = {
        'seed': phil_seed,
        'idr': phil_signer.identifier}
    do('new key with seed {seed}', expect=['Key created in keyring Phil',
                                           'Identifier for key is {idr}',
                                           'Current identifier set to {idr}'],
       mapper=mapper)

    addNym(be, do, trusteeCli,
           phil_signer.identifier,
           verkey=phil_signer.verkey,
           role=Roles.TRUSTEE.name)

    return philCLI
예제 #9
0
def philCli(be, do, philCLI, trusteeCli, poolTxnData):

    be(philCLI)

    do('prompt Phil', expect=prompt_is('Phil'))

    do('new wallet Phil',
       expect=['New wallet Phil created', 'Active wallet set to "Phil"'])
    phil_seed = poolTxnData['seeds']['Steward1']
    phil_signer = DidSigner(seed=phil_seed.encode())

    mapper = {'seed': phil_seed, 'idr': phil_signer.identifier}
    do('new key with seed {seed}',
       expect=[
           'Key created in wallet Phil', 'DID for key is {idr}',
           'Current DID set to {idr}'
       ],
       mapper=mapper)

    addNym(be,
           do,
           trusteeCli,
           phil_signer.identifier,
           verkey=phil_signer.verkey,
           role=Roles.TRUSTEE.name)

    return philCLI
예제 #10
0
def philCli(be, do, philCLI, trusteeCli):

    be(philCLI)

    do('prompt Phil', expect=prompt_is('Phil'))

    do('new keyring Phil',
       expect=['New keyring Phil created', 'Active keyring set to "Phil"'])
    phil_seed = '11111111111111111111111111111111'
    phil_signer = DidSigner(seed=phil_seed.encode())

    mapper = {'seed': phil_seed, 'idr': phil_signer.identifier}
    do('new key with seed {seed}',
       expect=[
           'Key created in keyring Phil', 'Identifier for key is {idr}',
           'Current identifier set to {idr}'
       ],
       mapper=mapper)

    addNym(be,
           do,
           trusteeCli,
           phil_signer.identifier,
           verkey=phil_signer.verkey,
           role=Roles.TRUSTEE.name)

    return philCLI
예제 #11
0
def philCli(be, do, philCLI):
    be(philCLI)
    do('prompt Phil', expect=prompt_is('Phil'))

    do('new keyring Phil', expect=['New keyring Phil created',
                                   'Active keyring set to "Phil"'])

    mapper = {
        'seed': '11111111111111111111111111111111',
        'idr': '5rArie7XKukPCaEwq5XGQJnM9Fc5aZE3M9HAPVfMU2xC'}
    do('new key with seed {seed}', expect=['Key created in keyring Phil',
                                           'Identifier for key is {idr}',
                                           'Current identifier set to {idr}'],
       mapper=mapper)

    return philCLI
예제 #12
0
def philCli(be, do, philCLI):
    be(philCLI)
    do('prompt Phil', expect=prompt_is('Phil'))

    do('new keyring Phil', expect=['New keyring Phil created',
                                   'Active keyring set to "Phil"'])

    mapper = {
        'seed': '11111111111111111111111111111111',
        'idr': '5rArie7XKukPCaEwq5XGQJnM9Fc5aZE3M9HAPVfMU2xC'}
    do('new key with seed {seed}', expect=['Key created in keyring Phil',
                                           'Identifier for key is {idr}',
                                           'Current identifier set to {idr}'],
       mapper=mapper)

    return philCLI
예제 #13
0
def setPromptAndKeyring(do, name, newKeyringOut, userMap):
    do('prompt {}'.format(name), expect=prompt_is(name))
    do('new keyring {}'.format(name), expect=newKeyringOut, mapper=userMap)
예제 #14
0
def alice_connected(alice, be, do, poolNodesCreated):
    be(alice)
    do(None, expect=prompt_is("sovrin"))
    do('connect test', within=5, expect=["Connected to test"])
    do(None, expect=prompt_is("sovrin@test"))
예제 #15
0
def aliceCli(be, do, poolNodesStarted, aliceCLI, connectedToTest, wallet):
    be(aliceCLI)
    do('prompt Alice', expect=prompt_is('Alice'))
    addAndActivateCLIWallet(aliceCLI, wallet)
    do('connect test', within=3, expect=connectedToTest)
    return aliceCLI
예제 #16
0
def aliceCli(be, do, poolNodesStarted, aliceCLI, connectedToTest, wallet):
    be(aliceCLI)
    do('prompt Alice', expect=prompt_is('Alice'))
    addAndActivateCLIWallet(aliceCLI, wallet)
    do('connect test', within=3, expect=connectedToTest)
    return aliceCLI
예제 #17
0
def setPromptAndKeyring(do, name, newKeyringOut, userMap):
    do('prompt {}'.format(name), expect=prompt_is(name))
    do('new keyring {}'.format(name), expect=newKeyringOut, mapper=userMap)
예제 #18
0
def test_disconnect_when_not_connected(alice, be, do):
    be(alice)
    do(None, expect=prompt_is("sovrin"))
    do('disconnect', within=1, expect=['Not connected to any environment.'])
    do(None, expect=prompt_is("sovrin"))
예제 #19
0
def alice_connected(alice, be, do, poolNodesCreated):
    be(alice)
    do(None, expect=prompt_is("sovrin"))
    do('connect test', within=5, expect=["Connected to test"])
    do(None, expect=prompt_is("sovrin@test"))
예제 #20
0
def test_disconnect_when_not_connected(alice, be, do):
    be(alice)
    do(None, expect=prompt_is("sovrin"))
    do('disconnect', within=1, expect=['Not connected to any environment.'])
    do(None, expect=prompt_is("sovrin"))
예제 #21
0
def _connectTo(envName, do, cli):
    do('connect {}'.format(envName), within=10,
       expect=["Connected to {}".format(envName)])
    prompt_is("{}@{}".format(cli.name, envName))