aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/importprunedfunds.py
diff options
context:
space:
mode:
Diffstat (limited to 'qa/rpc-tests/importprunedfunds.py')
-rwxr-xr-xqa/rpc-tests/importprunedfunds.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/qa/rpc-tests/importprunedfunds.py b/qa/rpc-tests/importprunedfunds.py
index 0dee8ad4ec..b4c8ee6c70 100755
--- a/qa/rpc-tests/importprunedfunds.py
+++ b/qa/rpc-tests/importprunedfunds.py
@@ -2,7 +2,7 @@
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
+"""Test the importprunedfunds and removeprunedfunds RPCs."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
@@ -21,7 +21,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
self.sync_all()
def run_test(self):
- print("Mining blocks...")
+ self.log.info("Mining blocks...")
self.nodes[0].generate(101)
self.sync_all()
@@ -76,12 +76,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
self.sync_all()
#Import with no affiliated address
- try:
- self.nodes[1].importprunedfunds(rawtxn1, proof1)
- except JSONRPCException as e:
- assert('No addresses' in e.error['message'])
- else:
- assert(False)
+ assert_raises_jsonrpc(-5, "No addresses", self.nodes[1].importprunedfunds, rawtxn1, proof1)
balance1 = self.nodes[1].getbalance("", 0, True)
assert_equal(balance1, Decimal(0))
@@ -112,12 +107,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
assert_equal(address_info['ismine'], True)
#Remove transactions
- try:
- self.nodes[1].removeprunedfunds(txnid1)
- except JSONRPCException as e:
- assert('does not exist' in e.error['message'])
- else:
- assert(False)
+ assert_raises_jsonrpc(-8, "Transaction does not exist in wallet.", self.nodes[1].removeprunedfunds, txnid1)
balance1 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance1, Decimal('0.075'))