Skip to content

Commit 83253b3

Browse files
committed
add_test
1 parent c69d80d commit 83253b3

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
@@ -2294,6 +2294,19 @@ def test_tunnel_debuglog(self):
22942294
lines = output.getvalue().splitlines()
22952295
self.assertIn('header: {}'.format(expected_header), lines)
22962296

2297+
def test_proxy_response_headers(self):
2298+
expected_header = ('X-Dummy', '1')
2299+
response_text = 'HTTP/1.0 200 OK\r\n{}: {}\r\n\r\n'.format(
2300+
*expected_header
2301+
)
2302+
2303+
self.conn._create_connection = self._create_connection(response_text)
2304+
self.conn.set_tunnel('destination.com')
2305+
2306+
self.conn.request('PUT', '/', '')
2307+
headers = self.conn._proxy_response_headers
2308+
self.assertIn(expected_header, headers.items())
2309+
22972310

22982311
if __name__ == '__main__':
22992312
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)