MCPcopy Create free account
hub / github.com/python/cpython / test_connect_with_tunnel_idna

Method test_connect_with_tunnel_idna

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

Source from the content-addressed store, hash-verified

2514 self.conn.sock.data)
2515
2516 def test_connect_with_tunnel_idna(self):
2517 dest = '\u03b4\u03c0\u03b8.gr'
2518 dest_port = b'%s:%d' % (dest.encode('idna'), client.HTTP_PORT)
2519 expected = b'CONNECT %s HTTP/1.1\r\nHost: %s\r\n\r\n' % (
2520 dest_port, dest_port)
2521 self.conn.set_tunnel(dest)
2522 self.conn.request('HEAD', '/', '')
2523 self.assertEqual(self.conn.sock.host, self.host)
2524 self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
2525 self.assertIn(expected, self.conn.sock.data)
2526
2527 def test_tunnel_connect_single_send_connection_setup(self):
2528 """Regresstion test for https://bugs.python.org/issue43332."""

Callers

nothing calls this directly

Calls 5

assertInMethod · 0.80
encodeMethod · 0.45
set_tunnelMethod · 0.45
requestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected