MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_tunnel_debuglog

Method test_tunnel_debuglog

Lib/test/test_httplib.py:2530–2541  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2528 self.assertIn(b'Host: [1:2:3::4]:1234', self.conn.sock.data)
2529
2530 def test_tunnel_debuglog(self):
2531 expected_header = 'X-Dummy: 1'
2532 response_text = 'HTTP/1.0 200 OK\r\n{}\r\n\r\n'.format(expected_header)
2533
2534 self.conn.set_debuglevel(1)
2535 self.conn._create_connection = self._create_connection(response_text)
2536 self.conn.set_tunnel('destination.com')
2537
2538 with support.captured_stdout() as output:
2539 self.conn.request('PUT', '/', '')
2540 lines = output.getvalue().splitlines()
2541 self.assertIn('header: {}'.format(expected_header), lines)
2542
2543 def test_proxy_response_headers(self):
2544 expected_header = ('X-Dummy', '1')

Callers

nothing calls this directly

Calls 8

_create_connectionMethod · 0.95
assertInMethod · 0.80
formatMethod · 0.45
set_debuglevelMethod · 0.45
set_tunnelMethod · 0.45
requestMethod · 0.45
splitlinesMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected