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

Method test_connect_put_request

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

Source from the content-addressed store, hash-verified

2541 msg=f'unexpected proxy data sent {proxy_setup_data_sent!r}')
2542
2543 def test_connect_put_request(self):
2544 d = {
2545 b'host': b'destination.com',
2546 b'port': client.HTTP_PORT,
2547 }
2548 self.conn.set_tunnel(d[b'host'].decode('ascii'))
2549 self.conn.request('PUT', '/', '')
2550 self.assertEqual(self.conn.sock.host, self.host)
2551 self.assertEqual(self.conn.sock.port, self.port)
2552 self.assertIn(b'CONNECT %(host)s:%(port)d HTTP/1.1\r\n'
2553 b'Host: %(host)s:%(port)d\r\n\r\n' % d,
2554 self.conn.sock.data)
2555 self.assertIn(b'PUT / HTTP/1.1\r\nHost: %(host)s\r\n' % d,
2556 self.conn.sock.data)
2557
2558 def test_connect_put_request_ipv6(self):
2559 self.conn.set_tunnel('[1:2:3::4]', 1234)

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