Skip to content

Commit 30511e0

Browse files
committed
add_test
1 parent 5d07222 commit 30511e0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_httplib.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,6 +2390,19 @@ def test_tunnel_debuglog(self):
23902390
lines = output.getvalue().splitlines()
23912391
self.assertIn('header: {}'.format(expected_header), lines)
23922392

2393+
def test_proxy_response_headers(self):
2394+
expected_header = ('X-Dummy', '1')
2395+
response_text = 'HTTP/1.0 200 OK\r\n{}: {}\r\n\r\n'.format(
2396+
*expected_header
2397+
)
2398+
2399+
self.conn._create_connection = self._create_connection(response_text)
2400+
self.conn.set_tunnel('destination.com')
2401+
2402+
self.conn.request('PUT', '/', '')
2403+
headers = self.conn._proxy_response_headers
2404+
self.assertIn(expected_header, headers.items())
2405+
23932406

23942407
if __name__ == '__main__':
23952408
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)