@@ -37,7 +37,7 @@ def test_simple_request(node_class, httpbin_node_config):
3737 )
3838 assert resp .status == 200
3939 assert data ["method" ] == "GET"
40- assert data ["url" ] == "https ://httpbin.org /anything?key[]=1&key[]=2&q1&q2="
40+ assert data ["url" ] == "http ://localhost:8080 /anything?key[]=1&key[]=2&q1&q2="
4141
4242 # httpbin makes no-value query params into ''
4343 assert data ["args" ] == {
@@ -52,7 +52,8 @@ def test_simple_request(node_class, httpbin_node_config):
5252 "Content-Type" : "application/json" ,
5353 "Content-Length" : "15" ,
5454 "Custom" : "headeR" ,
55- "Host" : "httpbin.org" ,
55+ "Connection" : "keep-alive" ,
56+ "Host" : "localhost:8080" ,
5657 }
5758 assert all (v == data ["headers" ][k ] for k , v in request_headers .items ())
5859
@@ -71,11 +72,12 @@ def new_node(**kwargs):
7172 assert parsed == {
7273 "headers" : {
7374 "Accept-Encoding" : "identity" ,
74- "Host" : "httpbin.org" ,
75+ "Connection" : "keep-alive" ,
76+ "Host" : "localhost:8080" ,
7577 "User-Agent" : DEFAULT_USER_AGENT ,
7678 },
7779 "method" : "GET" ,
78- "url" : "https ://httpbin.org /anything" ,
80+ "url" : "http ://localhost:8080 /anything" ,
7981 }
8082
8183 node = new_node (http_compress = True )
@@ -85,11 +87,12 @@ def new_node(**kwargs):
8587 assert parsed == {
8688 "headers" : {
8789 "Accept-Encoding" : "gzip" ,
88- "Host" : "httpbin.org" ,
90+ "Connection" : "keep-alive" ,
91+ "Host" : "localhost:8080" ,
8992 "User-Agent" : DEFAULT_USER_AGENT ,
9093 },
9194 "method" : "GET" ,
92- "url" : "https ://httpbin.org /anything" ,
95+ "url" : "http ://localhost:8080 /anything" ,
9396 }
9497
9598 resp , data = node .perform_request ("GET" , "/anything" , body = b"hello, world!" )
@@ -100,11 +103,12 @@ def new_node(**kwargs):
100103 "Accept-Encoding" : "gzip" ,
101104 "Content-Encoding" : "gzip" ,
102105 "Content-Length" : "33" ,
103- "Host" : "httpbin.org" ,
106+ "Connection" : "keep-alive" ,
107+ "Host" : "localhost:8080" ,
104108 "User-Agent" : DEFAULT_USER_AGENT ,
105109 },
106110 "method" : "GET" ,
107- "url" : "https ://httpbin.org /anything" ,
111+ "url" : "http ://localhost:8080 /anything" ,
108112 }
109113
110114 resp , data = node .perform_request (
@@ -121,16 +125,17 @@ def new_node(**kwargs):
121125 "Content-Encoding" : "gzip" ,
122126 "Content-Length" : "36" ,
123127 "Content-Type" : "application/json" ,
124- "Host" : "httpbin.org" ,
128+ "Connection" : "keep-alive" ,
129+ "Host" : "localhost:8080" ,
125130 "User-Agent" : DEFAULT_USER_AGENT ,
126131 },
127132 "method" : "POST" ,
128- "url" : "https ://httpbin.org /anything" ,
133+ "url" : "http ://localhost:8080 /anything" ,
129134 }
130135
131136
132137def parse_httpbin (value ):
133- """Parses a response from httpbin.org /anything by stripping all the variable things"""
138+ """Parses a response from httpbin's /anything by stripping all the variable things"""
134139 if isinstance (value , bytes ):
135140 value = json .loads (value )
136141 else :
0 commit comments