@@ -43,27 +43,53 @@ def test_initialization_no_port(self):
43
43
assert c .host == 'httpbin.org'
44
44
assert c .port == 80
45
45
assert not c .secure
46
+ assert not c .proxy_host
47
+ assert not c .proxy_port
46
48
47
49
def test_initialization_inline_port (self ):
48
50
c = HTTP11Connection ('httpbin.org:443' )
49
51
50
52
assert c .host == 'httpbin.org'
51
53
assert c .port == 443
52
54
assert c .secure
55
+ assert not c .proxy_host
56
+ assert not c .proxy_port
53
57
54
58
def test_initialization_separate_port (self ):
55
59
c = HTTP11Connection ('localhost' , 8080 )
56
60
57
61
assert c .host == 'localhost'
58
62
assert c .port == 8080
59
63
assert not c .secure
64
+ assert not c .proxy_host
65
+ assert not c .proxy_port
60
66
61
67
def test_can_override_security (self ):
62
68
c = HTTP11Connection ('localhost' , 443 , secure = False )
63
69
64
70
assert c .host == 'localhost'
65
71
assert c .port == 443
66
72
assert not c .secure
73
+ assert not c .proxy_host
74
+ assert not c .proxy_port
75
+
76
+ def test_initialization_proxy (self ):
77
+ c = HTTP11Connection ('httpbin.org' , proxy = 'localhost' )
78
+
79
+ assert c .host == 'httpbin.org'
80
+ assert c .port == 80
81
+ assert not c .secure
82
+ assert c .proxy_host == 'localhost'
83
+ assert c .proxy_port == 8080
84
+
85
+ def test_initialization_proxy_with_port (self ):
86
+ c = HTTP11Connection ('httpbin.org' , proxy = 'localhost:8443' )
87
+
88
+ assert c .host == 'httpbin.org'
89
+ assert c .port == 80
90
+ assert not c .secure
91
+ assert c .proxy_host == 'localhost'
92
+ assert c .proxy_port == 8443
67
93
68
94
def test_basic_request (self ):
69
95
c = HTTP11Connection ('httpbin.org' )
0 commit comments