Cosmetics (trailing whitespace, comment conventions, etc.)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
@@ -37,13 +37,13 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read();
|
||||
out1 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out1, True)
|
||||
assert_equal(conn.sock!=None, True) # according to http/1.1 connection must still be open!
|
||||
|
||||
# send 2nd request without closing connection
|
||||
conn.request('POST', '/', '{"method": "getchaintips"}', headers)
|
||||
out2 = conn.getresponse().read();
|
||||
out2 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out2, True) # must also response with a correct json-rpc message
|
||||
assert_equal(conn.sock!=None, True) # according to http/1.1 connection must still be open!
|
||||
conn.close()
|
||||
@@ -54,13 +54,13 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read();
|
||||
out1 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out1, True)
|
||||
assert_equal(conn.sock!=None, True) # according to http/1.1 connection must still be open!
|
||||
|
||||
# send 2nd request without closing connection
|
||||
conn.request('POST', '/', '{"method": "getchaintips"}', headers)
|
||||
out2 = conn.getresponse().read();
|
||||
out2 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out2, True) # must also response with a correct json-rpc message
|
||||
assert_equal(conn.sock!=None, True) # according to http/1.1 connection must still be open!
|
||||
conn.close()
|
||||
@@ -71,7 +71,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read();
|
||||
out1 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out1, True)
|
||||
assert_equal(conn.sock!=None, False) # now the connection must be closed after the response
|
||||
|
||||
@@ -83,7 +83,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn = httplib.HTTPConnection(urlNode1.hostname, urlNode1.port)
|
||||
conn.connect()
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read();
|
||||
out1 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out1, True)
|
||||
|
||||
# node2 (third node) is running with standard keep-alive parameters which means keep-alive is on
|
||||
@@ -94,7 +94,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn = httplib.HTTPConnection(urlNode2.hostname, urlNode2.port)
|
||||
conn.connect()
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read();
|
||||
out1 = conn.getresponse().read()
|
||||
assert_equal('"error":null' in out1, True)
|
||||
assert_equal(conn.sock!=None, True) # connection must be closed because bitcoind should use keep-alive by default
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ from test_framework.util import initialize_chain_clean, start_node, \
|
||||
import time
|
||||
|
||||
class InvalidateTest(BitcoinTestFramework):
|
||||
|
||||
|
||||
def setup_chain(self):
|
||||
print("Initializing test directory "+self.options.tmpdir)
|
||||
initialize_chain_clean(self.options.tmpdir, 3)
|
||||
|
||||
@@ -25,12 +25,12 @@ def get_sub_array_from_array(object_array, to_match):
|
||||
return []
|
||||
|
||||
def check_array_result(object_array, to_match, expected, should_not_find = False):
|
||||
"""
|
||||
'''
|
||||
Pass in array of JSON objects, a dictionary with key/value pairs
|
||||
to match against, and another dictionary with expected key/value
|
||||
pairs.
|
||||
If the should_not_find flag is true, to_match should not be found in object_array
|
||||
"""
|
||||
'''
|
||||
if should_not_find == True:
|
||||
expected = { }
|
||||
num_matched = 0
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
# Test REST interface
|
||||
#
|
||||
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_greater_than, \
|
||||
initialize_chain_clean, start_nodes, connect_nodes_bi
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
# Test for -rpcbind, as well as -rpcallowip and -rpcconnect
|
||||
|
||||
# Add python-bitcoinrpc to module search path:
|
||||
# Dependency: python-bitcoinrpc
|
||||
|
||||
from test_framework.util import assert_equal, check_json_precision, \
|
||||
initialize_chain, start_nodes, stop_nodes, wait_bitcoinds, \
|
||||
|
||||
@@ -53,7 +53,7 @@ class ZapWalletTXesTest (BitcoinTestFramework):
|
||||
tx3 = self.nodes[0].gettransaction(txid3)
|
||||
assert_equal(tx3['txid'], txid3) # tx3 must be available (unconfirmed)
|
||||
|
||||
#restart bitcoind
|
||||
# restart zcashd
|
||||
self.nodes[0].stop()
|
||||
bitcoind_processes[0].wait()
|
||||
self.nodes[0] = start_node(0,self.options.tmpdir)
|
||||
@@ -64,7 +64,7 @@ class ZapWalletTXesTest (BitcoinTestFramework):
|
||||
self.nodes[0].stop()
|
||||
bitcoind_processes[0].wait()
|
||||
|
||||
#restart bitcoind with zapwallettxes
|
||||
# restart zcashd with zapwallettxes
|
||||
self.nodes[0] = start_node(0,self.options.tmpdir, ["-zapwallettxes=1"])
|
||||
|
||||
aException = False
|
||||
|
||||
Reference in New Issue
Block a user