(self)
| 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): |
no test coverage detected