MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / check_default_connection

Method check_default_connection

test/functional/interface_http.py:141–156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

139
140
141 def check_default_connection(self):
142 self.log.info("Checking default HTTP/1.1 connection persistence")
143 conn = BitcoinHTTPConnection(self.node)
144 # Make request without explicit "Connection" header
145 response1 = conn.post('/', '{"method": "getbestblockhash"}').read()
146 assert b'"error":null' in response1
147 # Connection still open after request
148 assert not conn.sock_closed()
149 # Make second request without explicit "Connection" header
150 response2 = conn.post('/', '{"method": "getchaintips"}').read()
151 assert b'"error":null' in response2
152 # Connection still open after second request
153 assert not conn.sock_closed()
154 # Close
155 conn.close_sock()
156 assert conn.sock_closed()
157
158
159 def check_keepalive_connection(self):

Callers 1

run_testMethod · 0.95

Calls 6

postMethod · 0.95
sock_closedMethod · 0.95
close_sockMethod · 0.95
infoMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected