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/rpcbind_test.py | |
parent | ce01e6226ce52b88c644b0cb89852278edbdf33b (diff) | |
download | bitcoin-c9bd0f64212cd600daf30c9c59035bfe9f07b81b.tar.xz |
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/rpcbind_test.py')
-rwxr-xr-x | qa/rpc-tests/rpcbind_test.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index 220bf4ddd0..8720a345ce 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -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() |