@@ -44,7 +44,6 @@ def test_initialization_no_port(self):
4444 assert c .port == 80
4545 assert not c .secure
4646 assert not c .proxy_host
47- assert not c .proxy_port
4847
4948 def test_initialization_inline_port (self ):
5049 c = HTTP11Connection ('httpbin.org:443' )
@@ -53,7 +52,6 @@ def test_initialization_inline_port(self):
5352 assert c .port == 443
5453 assert c .secure
5554 assert not c .proxy_host
56- assert not c .proxy_port
5755
5856 def test_initialization_separate_port (self ):
5957 c = HTTP11Connection ('localhost' , 8080 )
@@ -62,7 +60,6 @@ def test_initialization_separate_port(self):
6260 assert c .port == 8080
6361 assert not c .secure
6462 assert not c .proxy_host
65- assert not c .proxy_port
6663
6764 def test_can_override_security (self ):
6865 c = HTTP11Connection ('localhost' , 443 , secure = False )
@@ -71,26 +68,35 @@ def test_can_override_security(self):
7168 assert c .port == 443
7269 assert not c .secure
7370 assert not c .proxy_host
74- assert not c .proxy_port
7571
7672 def test_initialization_proxy (self ):
77- c = HTTP11Connection ('httpbin.org' , proxy = 'localhost' )
73+ c = HTTP11Connection ('httpbin.org' , proxy_host = 'localhost' )
7874
7975 assert c .host == 'httpbin.org'
8076 assert c .port == 80
8177 assert not c .secure
8278 assert c .proxy_host == 'localhost'
8379 assert c .proxy_port == 8080
8480
85- def test_initialization_proxy_with_port (self ):
86- c = HTTP11Connection ('httpbin.org' , proxy = 'localhost:8443' )
81+ def test_initialization_proxy_with_inline_port (self ):
82+ c = HTTP11Connection ('httpbin.org' , proxy_host = 'localhost:8443' )
8783
8884 assert c .host == 'httpbin.org'
8985 assert c .port == 80
9086 assert not c .secure
9187 assert c .proxy_host == 'localhost'
9288 assert c .proxy_port == 8443
9389
90+ def test_initialization_proxy_with_separate_port (self ):
91+ c = HTTP11Connection ('httpbin.org' , proxy_host = 'localhost' , proxy_port = 8443 )
92+
93+ assert c .host == 'httpbin.org'
94+ assert c .port == 80
95+ assert not c .secure
96+ assert c .proxy_host == 'localhost'
97+ assert c .proxy_port == 8443
98+
99+
94100 def test_basic_request (self ):
95101 c = HTTP11Connection ('httpbin.org' )
96102 c ._sock = sock = DummySocket ()
0 commit comments