diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-09-24 23:56:32 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-10-18 23:26:06 +0100 |
commit | 0cb3cad166bbeb75e9cc1512286453f8e7d4f717 (patch) | |
tree | 0ef9c914a754b5d0a7c6692ae28dbf153ed4035a /test/functional | |
parent | cc3377360c417780f5cbd7bd69b438817a9d60be (diff) | |
download | bitcoin-0cb3cad166bbeb75e9cc1512286453f8e7d4f717.tar.xz |
qa: Add tests for listwalletdir RPC
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_multiwallet.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 435821ec48..aca84477f6 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -38,6 +38,8 @@ class MultiWalletTest(BitcoinTestFramework): return wallet_dir(name, "wallet.dat") return wallet_dir(name) + assert_equal(self.nodes[0].listwalletdir(), { 'wallets': [{ 'name': '' }] }) + # check wallet.dat is created self.stop_nodes() assert_equal(os.path.isfile(wallet_dir('wallet.dat')), True) @@ -68,6 +70,8 @@ class MultiWalletTest(BitcoinTestFramework): wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', ''] extra_args = ['-wallet={}'.format(n) for n in wallet_names] self.start_node(0, extra_args) + assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w7', 'w1', 'w8', 'w'])) + assert_equal(set(node.listwallets()), set(wallet_names)) # check that all requested wallets were created @@ -139,6 +143,8 @@ class MultiWalletTest(BitcoinTestFramework): self.restart_node(0, extra_args) + assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w7', 'w8_copy', 'w1', 'w8', 'w'])) + wallets = [wallet(w) for w in wallet_names] wallet_bad = wallet("bad") @@ -276,6 +282,8 @@ class MultiWalletTest(BitcoinTestFramework): assert_equal(self.nodes[0].listwallets(), ['w1']) assert_equal(w1.getwalletinfo()['walletname'], 'w1') + assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w9', 'w7', 'w8_copy', 'w1', 'w8', 'w'])) + # Test backing up and restoring wallets self.log.info("Test wallet backup") self.restart_node(0, ['-nowallet']) |