MCPcopy Index your code
hub / github.com/python/cpython / test_tunnel_debuglog

Method test_tunnel_debuglog

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

Source from the content-addressed store, hash-verified

2572 self.assertIn(b'Host: [1:2:3::4]:1234', self.conn.sock.data)
2573
2574 def test_tunnel_debuglog(self):
2575 expected_header = 'X-Dummy: 1'
2576 response_text = 'HTTP/1.0 200 OK\r\n{}\r\n\r\n'.format(expected_header)
2577
2578 self.conn.set_debuglevel(1)
2579 self.conn._create_connection = self._create_connection(response_text)
2580 self.conn.set_tunnel('destination.com')
2581
2582 with support.captured_stdout() as output:
2583 self.conn.request('PUT', '/', '')
2584 lines = output.getvalue().splitlines()
2585 self.assertIn('header: {}'.format(expected_header), lines)
2586
2587 def test_proxy_response_headers(self):
2588 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