diff options
author | John Newbery <john@johnnewbery.com> | 2017-03-07 14:08:59 -0500 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-03-15 11:56:25 -0400 |
commit | c9bd0f64212cd600daf30c9c59035bfe9f07b81b (patch) | |
tree | 9f587fadcbbd92fb983a770af4a1cf5084bc8b01 /qa/rpc-tests/getblocktemplate_proposals.py | |
parent | ce01e6226ce52b88c644b0cb89852278edbdf33b (diff) |
Fix RPC failure testing (2 of 2)
Commit 9db8eecac1c713c760c0217b6acb7455c657fa8b improved the
assert_raises_jsonrpc() function for better testing of RPC failure
modes. This commit completes the job by removing remaining broken
try-except RPC testing from the individual test cases and replacing it
with calls to assert_raises_jsonrpc().
Diffstat (limited to 'qa/rpc-tests/getblocktemplate_proposals.py')
-rwxr-xr-x | qa/rpc-tests/getblocktemplate_proposals.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py index 3b17dfcfb5..67745f77d1 100755 --- a/qa/rpc-tests/getblocktemplate_proposals.py +++ b/qa/rpc-tests/getblocktemplate_proposals.py @@ -105,7 +105,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework): # Test 3: Truncated final tx lastbyte = txlist[-1].pop() - assert_raises(JSONRPCException, assert_template, node, tmpl, txlist, 'n/a') + assert_raises_jsonrpc(-22, "Block decode failed", assert_template, node, tmpl, txlist, 'n/a') txlist[-1].append(lastbyte) # Test 4: Add an invalid tx to the end (duplicate of gen tx) @@ -126,7 +126,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework): # Test 7: Bad tx count txlist.append(b'') - assert_raises(JSONRPCException, assert_template, node, tmpl, txlist, 'n/a') + assert_raises_jsonrpc(-22, 'Block decode failed', assert_template, node, tmpl, txlist, 'n/a') txlist.pop() # Test 8: Bad bits |