aboutsummaryrefslogtreecommitdiff
path: root/test/functional/multiwallet.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-06-02 14:30:36 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-10-03 18:18:17 +0200
commitfc2aa09cf382f024f461e103f2500e95ddb692e5 (patch)
treeb0148b97dda0141ef4fccf84120b74816079cfdd /test/functional/multiwallet.py
parentfb7b5293844ea6adc5dcf5ad0a0c5890b4495939 (diff)
downloadbitcoin-fc2aa09cf382f024f461e103f2500e95ddb692e5.tar.xz
[tests] Introduce TestNode
TestNode is a class responsible for all state related to a bitcoind node under test. It stores local state, is responsible for tracking the bitcoind process and delegates unrecognised messages to the RPC connection. This commit changes start_nodes and stop_nodes to start and stop the bitcoind nodes in parallel, making test setup and teardown much faster. Github-Pull: #10711 Rebased-From: 7897338918dac072e788b8ab2919d4559f311bef
Diffstat (limited to 'test/functional/multiwallet.py')
-rwxr-xr-xtest/functional/multiwallet.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/functional/multiwallet.py b/test/functional/multiwallet.py
index 5679f40503..fc6e8e325f 100755
--- a/test/functional/multiwallet.py
+++ b/test/functional/multiwallet.py
@@ -35,11 +35,15 @@ class MultiWalletTest(BitcoinTestFramework):
self.nodes[0] = self.start_node(0, self.options.tmpdir, self.extra_args[0])
- w1 = self.nodes[0] / "wallet/w1"
+ w1 = self.nodes[0].get_wallet_rpc("w1")
+ w2 = self.nodes[0].get_wallet_rpc("w2")
+ w3 = self.nodes[0].get_wallet_rpc("w3")
+ wallet_bad = self.nodes[0].get_wallet_rpc("bad")
+
w1.generate(1)
# accessing invalid wallet fails
- assert_raises_jsonrpc(-18, "Requested wallet does not exist or is not loaded", (self.nodes[0] / "wallet/bad").getwalletinfo)
+ assert_raises_jsonrpc(-18, "Requested wallet does not exist or is not loaded", wallet_bad.getwalletinfo)
# accessing wallet RPC without using wallet endpoint fails
assert_raises_jsonrpc(-19, "Wallet file not specified", self.nodes[0].getwalletinfo)
@@ -50,14 +54,12 @@ class MultiWalletTest(BitcoinTestFramework):
w1_name = w1_info['walletname']
assert_equal(w1_name, "w1")
- # check w1 wallet balance
- w2 = self.nodes[0] / "wallet/w2"
+ # check w2 wallet balance
w2_info = w2.getwalletinfo()
assert_equal(w2_info['immature_balance'], 0)
w2_name = w2_info['walletname']
assert_equal(w2_name, "w2")
- w3 = self.nodes[0] / "wallet/w3"
w3_name = w3.getwalletinfo()['walletname']
assert_equal(w3_name, "w3")