#NEWLINE# def test_no_proxy( self ) : #NEWLINE# #INDENT# ' Starting with Agent 5.0.0, there should always be a local forwarder\n        running and all payloads should go through it. So we should make sure\n        that we pass the no_proxy environment variable that will be used by requests\n        (See: https://github.com/kennethreitz/requests/pull/945 )\n        ' #NEWLINE# from requests.utils import get_environ_proxies #NEWLINE# from os import environ as env #NEWLINE# env [ 'http_proxy' ] = 'http://localhost:3128' #NEWLINE# env [ 'https_proxy' ] = env [ 'http_proxy' ] #NEWLINE# env [ 'HTTP_PROXY' ] = env [ 'http_proxy' ] #NEWLINE# env [ 'HTTPS_PROXY' ] = env [ 'http_proxy' ] #NEWLINE# self . assertTrue ( ( 'no_proxy' in env ) ) #NEWLINE# self . assertEquals ( env [ 'no_proxy' ] , '127.0.0.1,localhost,169.254.169.254' ) #NEWLINE# self . assertEquals ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , get_environ_proxies ( 'http://localhost:17123/intake' ) ) #NEWLINE# expected_proxies = { #NEWLINE# #INDENT# 'http' : 'http://localhost:3128' , #NEWLINE# 'https' : 'http://localhost:3128' , #NEWLINE# 'no' : '127.0.0.1,localhost,169.254.169.254' , #NEWLINE# #UNINDENT# } #NEWLINE# environ_proxies = get_environ_proxies ( 'https://www.google.com' ) #NEWLINE# self . assertEquals ( expected_proxies , expected_proxies , ( expected_proxies , environ_proxies ) ) #NEWLINE# del env [ 'http_proxy' ] #NEWLINE# del env [ 'https_proxy' ] #NEWLINE# del env [ 'HTTP_PROXY' ] #NEWLINE# del env [ 'HTTPS_PROXY' ]