Skip to content

Commit 3707fcd

Browse files
committed
[wallet] [tests] Add listwallets to multiwallet test
1 parent 9508761 commit 3707fcd

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

test/functional/multiwallet.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
# Copyright (c) 2017 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5-
"""Test multiwallet."""
5+
"""Test multiwallet.
6+
7+
Verify that a bitcoind node can load multiple wallet files
8+
"""
69
from test_framework.test_framework import BitcoinTestFramework
7-
from test_framework.util import *
10+
from test_framework.util import assert_equal, assert_raises_jsonrpc
811

912
class MultiWalletTest(BitcoinTestFramework):
1013

@@ -18,20 +21,28 @@ def run_test(self):
1821
w1 = self.nodes[0] / "wallet/w1"
1922
w1.generate(1)
2023

21-
#accessing wallet RPC without using wallet endpoint fails
24+
# accessing wallet RPC without using wallet endpoint fails
2225
assert_raises_jsonrpc(-32601, "Method not found", self.nodes[0].getwalletinfo)
2326

24-
#check w1 wallet balance
25-
walletinfo = w1.getwalletinfo()
26-
assert_equal(walletinfo['immature_balance'], 50)
27+
# check w1 wallet balance
28+
w1_info = w1.getwalletinfo()
29+
assert_equal(w1_info['immature_balance'], 50)
30+
w1_name = w1_info['walletname']
31+
assert_equal(w1_name, "w1")
2732

28-
#check w1 wallet balance
33+
# check w1 wallet balance
2934
w2 = self.nodes[0] / "wallet/w2"
30-
walletinfo = w2.getwalletinfo()
31-
assert_equal(walletinfo['immature_balance'], 0)
35+
w2_info = w2.getwalletinfo()
36+
assert_equal(w2_info['immature_balance'], 0)
37+
w2_name = w2_info['walletname']
38+
assert_equal(w2_name, "w2")
3239

3340
w3 = self.nodes[0] / "wallet/w3"
34-
41+
w3_name = w3.getwalletinfo()['walletname']
42+
assert_equal(w3_name, "w3")
43+
44+
assert_equal({"w1", "w2", "w3"}, {w1_name, w2_name, w3_name})
45+
3546
w1.generate(101)
3647
assert_equal(w1.getbalance(), 100)
3748
assert_equal(w2.getbalance(), 0)

test/functional/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
'mempool_spendcoinbase.py',
9090
'mempool_reorg.py',
9191
'mempool_persist.py',
92+
'multiwallet.py',
9293
'httpbasics.py',
9394
'multi_rpc.py',
9495
'proxy_test.py',

0 commit comments

Comments
 (0)