mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Fix RPC failure testing
Make sure that RPC tests are actually checking failures correctly by: - Catching JSON RPC exceptions and verifying the error codes and messages. - Failing the test case if the JSON RPC exception isn't raised.
This commit is contained in:
@@ -37,7 +37,7 @@ class NamedArgumentTest(BitcoinTestFramework):
|
||||
h = node.help(command='getinfo')
|
||||
assert(h.startswith('getinfo\n'))
|
||||
|
||||
assert_raises_jsonrpc(-8, node.help, random='getinfo')
|
||||
assert_raises_jsonrpc(-8, 'Unknown named parameter', node.help, random='getinfo')
|
||||
|
||||
h = node.getblockhash(height=0)
|
||||
node.getblock(blockhash=h)
|
||||
|
||||
Reference in New Issue
Block a user