@@ -290,40 +290,44 @@ async def test_head_workaround(self, aiohttp_fixed_head_bug):
290290
291291
292292@pytest .mark .asyncio
293- async def test_ssl_assert_fingerprint (httpbin_cert_fingerprint ):
293+ async def test_ssl_assert_fingerprint (cert_fingerprint ):
294294 with warnings .catch_warnings (record = True ) as w :
295295 node = AiohttpHttpNode (
296296 NodeConfig (
297297 scheme = "https" ,
298- host = "httpbin.org " ,
299- port = 443 ,
300- ssl_assert_fingerprint = httpbin_cert_fingerprint ,
298+ host = "localhost " ,
299+ port = 9200 ,
300+ ssl_assert_fingerprint = 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 == {
318+ "Connection" : "keep-alive" ,
319+ "Host" : "localhost:8080" ,
320+ "User-Agent" : DEFAULT_USER_AGENT ,
321+ }
318322
319323
320324@pytest .mark .asyncio
321325async def test_custom_headers ():
322326 node = AiohttpHttpNode (
323327 NodeConfig (
324- scheme = "https " ,
325- host = "httpbin.org " ,
326- port = 443 ,
328+ scheme = "http " ,
329+ host = "localhost " ,
330+ port = 8080 ,
327331 headers = {"accept-encoding" : "gzip" , "Content-Type" : "application/json" },
328332 )
329333 )
@@ -341,8 +345,9 @@ async def test_custom_headers():
341345 headers .pop ("X-Amzn-Trace-Id" , None )
342346 assert headers == {
343347 "Accept-Encoding" : "gzip" ,
348+ "Connection" : "keep-alive" ,
344349 "Content-Type" : "application/x-ndjson" ,
345- "Host" : "httpbin.org " ,
350+ "Host" : "localhost:8080 " ,
346351 "User-Agent" : "custom-agent/1.2.3" ,
347352 }
348353
@@ -351,9 +356,9 @@ async def test_custom_headers():
351356async def test_custom_user_agent ():
352357 node = AiohttpHttpNode (
353358 NodeConfig (
354- scheme = "https " ,
355- host = "httpbin.org " ,
356- port = 443 ,
359+ scheme = "http " ,
360+ host = "localhost " ,
361+ port = 8080 ,
357362 headers = {
358363 "accept-encoding" : "gzip" ,
359364 "Content-Type" : "application/json" ,
@@ -371,8 +376,9 @@ async def test_custom_user_agent():
371376 headers .pop ("X-Amzn-Trace-Id" , None )
372377 assert headers == {
373378 "Accept-Encoding" : "gzip" ,
379+ "Connection" : "keep-alive" ,
374380 "Content-Type" : "application/json" ,
375- "Host" : "httpbin.org " ,
381+ "Host" : "localhost:8080 " ,
376382 "User-Agent" : "custom-agent/1.2.3" ,
377383 }
378384
@@ -385,7 +391,7 @@ def test_repr():
385391@pytest .mark .asyncio
386392async def test_head ():
387393 node = AiohttpHttpNode (
388- NodeConfig (scheme = "https " , host = "httpbin.org " , port = 443 , http_compress = True )
394+ NodeConfig (scheme = "http " , host = "localhost " , port = 8080 , http_compress = True )
389395 )
390396 resp , data = await node .perform_request ("HEAD" , "/anything" )
391397
0 commit comments