@@ -31,13 +31,13 @@ def run_test(self):
3131 conn .request ('POST' , '/' , '{"method": "getbestblockhash"}' , headers )
3232 out1 = conn .getresponse ().read ()
3333 assert (b'"error":null' in out1 )
34- assert (conn .sock != None ) #according to http/1.1 connection must still be open!
34+ assert (conn .sock is not None ) #according to http/1.1 connection must still be open!
3535
3636 #send 2nd request without closing connection
3737 conn .request ('POST' , '/' , '{"method": "getchaintips"}' , headers )
3838 out1 = conn .getresponse ().read ()
3939 assert (b'"error":null' in out1 ) #must also response with a correct json-rpc message
40- assert (conn .sock != None ) #according to http/1.1 connection must still be open!
40+ assert (conn .sock is not None ) #according to http/1.1 connection must still be open!
4141 conn .close ()
4242
4343 #same should be if we add keep-alive because this should be the std. behaviour
@@ -48,13 +48,13 @@ def run_test(self):
4848 conn .request ('POST' , '/' , '{"method": "getbestblockhash"}' , headers )
4949 out1 = conn .getresponse ().read ()
5050 assert (b'"error":null' in out1 )
51- assert (conn .sock != None ) #according to http/1.1 connection must still be open!
51+ assert (conn .sock is not None ) #according to http/1.1 connection must still be open!
5252
5353 #send 2nd request without closing connection
5454 conn .request ('POST' , '/' , '{"method": "getchaintips"}' , headers )
5555 out1 = conn .getresponse ().read ()
5656 assert (b'"error":null' in out1 ) #must also response with a correct json-rpc message
57- assert (conn .sock != None ) #according to http/1.1 connection must still be open!
57+ assert (conn .sock is not None ) #according to http/1.1 connection must still be open!
5858 conn .close ()
5959
6060 #now do the same with "Connection: close"
@@ -65,7 +65,7 @@ def run_test(self):
6565 conn .request ('POST' , '/' , '{"method": "getbestblockhash"}' , headers )
6666 out1 = conn .getresponse ().read ()
6767 assert (b'"error":null' in out1 )
68- assert (conn .sock == None ) #now the connection must be closed after the response
68+ assert (conn .sock is None ) #now the connection must be closed after the response
6969
7070 #node1 (2nd node) is running with disabled keep-alive option
7171 urlNode1 = urllib .parse .urlparse (self .nodes [1 ].url )
@@ -88,7 +88,7 @@ def run_test(self):
8888 conn .request ('POST' , '/' , '{"method": "getbestblockhash"}' , headers )
8989 out1 = conn .getresponse ().read ()
9090 assert (b'"error":null' in out1 )
91- assert (conn .sock != None ) #connection must be closed because bitcoind should use keep-alive by default
91+ assert (conn .sock is not None ) #connection must be closed because bitcoind should use keep-alive by default
9292
9393 # Check excessive request size
9494 conn = http .client .HTTPConnection (urlNode2 .hostname , urlNode2 .port )
0 commit comments