@@ -295,35 +295,35 @@ async def test_ssl_assert_fingerprint(httpbin_cert_fingerprint):
295295 node = AiohttpHttpNode (
296296 NodeConfig (
297297 scheme = "https" ,
298- host = "httpbin.org " ,
299- port = 443 ,
298+ host = "localhost " ,
299+ port = 9200 ,
300300 ssl_assert_fingerprint = httpbin_cert_fingerprint ,
301301 )
302302 )
303303 resp , _ = await node .perform_request ("GET" , "/" )
304304
305- assert resp .status == 200
305+ assert resp .status == 401
306306 assert [str (x .message ) for x in w if x .category != DeprecationWarning ] == []
307307
308308
309309@pytest .mark .asyncio
310310async def test_default_headers ():
311- node = AiohttpHttpNode (NodeConfig (scheme = "https " , host = "httpbin.org " , port = 443 ))
311+ node = AiohttpHttpNode (NodeConfig (scheme = "http " , host = "localhost " , port = 8080 ))
312312 resp , data = await node .perform_request ("GET" , "/anything" )
313313
314314 assert resp .status == 200
315315 headers = json .loads (data )["headers" ]
316316 headers .pop ("X-Amzn-Trace-Id" , None )
317- assert headers == {"Host" : "httpbin.org " , "User-Agent" : DEFAULT_USER_AGENT }
317+ assert headers == {"Connection" : "keep-alive" , " Host" : "localhost:8080 " , "User-Agent" : DEFAULT_USER_AGENT }
318318
319319
320320@pytest .mark .asyncio
321321async def test_custom_headers ():
322322 node = AiohttpHttpNode (
323323 NodeConfig (
324- scheme = "https " ,
325- host = "httpbin.org " ,
326- port = 443 ,
324+ scheme = "http " ,
325+ host = "localhost " ,
326+ port = 8080 ,
327327 headers = {"accept-encoding" : "gzip" , "Content-Type" : "application/json" },
328328 )
329329 )
@@ -341,8 +341,9 @@ async def test_custom_headers():
341341 headers .pop ("X-Amzn-Trace-Id" , None )
342342 assert headers == {
343343 "Accept-Encoding" : "gzip" ,
344+ "Connection" : "keep-alive" ,
344345 "Content-Type" : "application/x-ndjson" ,
345- "Host" : "httpbin.org " ,
346+ "Host" : "localhost:8080 " ,
346347 "User-Agent" : "custom-agent/1.2.3" ,
347348 }
348349
@@ -351,9 +352,9 @@ async def test_custom_headers():
351352async def test_custom_user_agent ():
352353 node = AiohttpHttpNode (
353354 NodeConfig (
354- scheme = "https " ,
355- host = "httpbin.org " ,
356- port = 443 ,
355+ scheme = "http " ,
356+ host = "localhost " ,
357+ port = 8080 ,
357358 headers = {
358359 "accept-encoding" : "gzip" ,
359360 "Content-Type" : "application/json" ,
@@ -371,8 +372,9 @@ async def test_custom_user_agent():
371372 headers .pop ("X-Amzn-Trace-Id" , None )
372373 assert headers == {
373374 "Accept-Encoding" : "gzip" ,
375+ "Connection" : "keep-alive" ,
374376 "Content-Type" : "application/json" ,
375- "Host" : "httpbin.org " ,
377+ "Host" : "localhost:8080 " ,
376378 "User-Agent" : "custom-agent/1.2.3" ,
377379 }
378380
@@ -385,7 +387,7 @@ def test_repr():
385387@pytest .mark .asyncio
386388async def test_head ():
387389 node = AiohttpHttpNode (
388- NodeConfig (scheme = "https " , host = "httpbin.org " , port = 443 , http_compress = True )
390+ NodeConfig (scheme = "http " , host = "localhost " , port = 8080 , http_compress = True )
389391 )
390392 resp , data = await node .perform_request ("HEAD" , "/anything" )
391393
0 commit comments