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

Method test_connect_with_tunnel

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

Source from the content-addressed store, hash-verified

2433 'destination.com')
2434
2435 def test_connect_with_tunnel(self):
2436 d = {
2437 b'host': b'destination.com',
2438 b'port': client.HTTP_PORT,
2439 }
2440 self.conn.set_tunnel(d[b'host'].decode('ascii'))
2441 self.conn.request('HEAD', '/', '')
2442 self.assertEqual(self.conn.sock.host, self.host)
2443 self.assertEqual(self.conn.sock.port, self.port)
2444 self.assertIn(b'CONNECT %(host)s:%(port)d HTTP/1.1\r\n'
2445 b'Host: %(host)s:%(port)d\r\n\r\n' % d,
2446 self.conn.sock.data)
2447 self.assertIn(b'HEAD / HTTP/1.1\r\nHost: %(host)s\r\n' % d,
2448 self.conn.sock.data)
2449
2450 def test_connect_with_tunnel_with_default_port(self):
2451 d = {

Callers

nothing calls this directly

Calls 5

assertInMethod · 0.80
set_tunnelMethod · 0.45
decodeMethod · 0.45
requestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected