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"))
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"))
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"))
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"))
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"))
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
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
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
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
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
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
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
def setPromptAndKeyring(do, name, newKeyringOut, userMap): do('prompt {}'.format(name), expect=prompt_is(name)) do('new keyring {}'.format(name), expect=newKeyringOut, mapper=userMap)
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"))
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
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
def setPromptAndKeyring(do, name, newKeyringOut, userMap): do('prompt {}'.format(name), expect=prompt_is(name)) do('new keyring {}'.format(name), expect=newKeyringOut, mapper=userMap)
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"))
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"))
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"))
def _connectTo(envName, do, cli): do('connect {}'.format(envName), within=10, expect=["Connected to {}".format(envName)]) prompt_is("{}@{}".format(cli.name, envName))