This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ def test_initialization_proxy_with_separate_port(self):
9696 assert c .proxy_host == 'localhost'
9797 assert c .proxy_port == 8443
9898
99+ def test_initialization_with_ipv6_addresses_proxy_inline_port (self ):
100+ c = HTTP11Connection ('abcd:dcba::1234' , proxy_host = '[ffff:aaaa::1]:8443' )
101+
102+ assert c .host == 'abcd:dcba::1234'
103+ assert c .port == 80
104+ assert not c .secure
105+ assert c .proxy_host == 'ffff:aaaa::1'
106+ assert c .proxy_port == 8443
99107
100108 def test_basic_request (self ):
101109 c = HTTP11Connection ('httpbin.org' )
Original file line number Diff line number Diff line change @@ -63,6 +63,15 @@ def test_connections_can_parse_proxy_hosts_and_ports(self):
6363 assert c .proxy_host == 'localhost'
6464 assert c .proxy_port == 8443
6565
66+ def test_connections_can_parse_ipv6_hosts_and_ports (self ):
67+ c = HTTP20Connection ('abcd:dcba::1234' ,
68+ proxy_host = '[ffff:aaaa::1]:8443' )
69+
70+ assert c .host == 'abcd:dcba::1234'
71+ assert c .port == 80
72+ assert c .proxy_host == 'ffff:aaaa::1'
73+ assert c .proxy_port == 8443
74+
6675 def test_putrequest_establishes_new_stream (self ):
6776 c = HTTP20Connection ("www.google.com" )
6877
You can’t perform that action at this time.
0 commit comments