mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Fix RPC failure testing (2 of 2)
Commit 9db8eecac1 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().
This commit is contained in:
@@ -92,11 +92,7 @@ class RPCBindTest(BitcoinTestFramework):
|
||||
|
||||
# Check that with invalid rpcallowip, we are denied
|
||||
self.run_allowip_test([non_loopback_ip], non_loopback_ip, defaultport)
|
||||
try:
|
||||
self.run_allowip_test(['1.1.1.1'], non_loopback_ip, defaultport)
|
||||
assert(not 'Connection not denied by rpcallowip as expected')
|
||||
except JSONRPCException:
|
||||
pass
|
||||
assert_raises_jsonrpc(-342, "non-JSON HTTP response with '403 Forbidden' from server", self.run_allowip_test, ['1.1.1.1'], non_loopback_ip, defaultport)
|
||||
|
||||
if __name__ == '__main__':
|
||||
RPCBindTest().main()
|
||||
|
||||
Reference in New Issue
Block a user