#NEWLINE# @ patch ( 'requests.get' ) #NEWLINE# def test_proxy_servers( fake_request ) : #NEWLINE# #INDENT# 'Test that providing a dictionary of proxy servers works.' #NEWLINE# proxies = { #NEWLINE# #INDENT# 'http' : 'myproxyserver:1234' , #NEWLINE# #UNINDENT# } #NEWLINE# client = soundcloud . Client ( client_id = 'foo' , proxies = proxies ) #NEWLINE# expected_url = ( '%s?%s' % ( client . _resolve_resource_name ( 'me' ) , urlencode ( { #NEWLINE# #INDENT# 'client_id' : 'foo' , #NEWLINE# #UNINDENT# } ) ) ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'User-Agent' : soundcloud . USER_AGENT , #NEWLINE# 'Accept' : 'application/json' , #NEWLINE# #UNINDENT# } #NEWLINE# fake_request . expects_call ( ) . with_args ( expected_url , headers = headers , proxies = proxies , allow_redirects = True ) . returns ( MockResponse ( '{}' ) ) #NEWLINE# client . get ( '/me' )