#NEWLINE# @ fudge . patch ( 'requests.post' ) #NEWLINE# def test_exchange_code_non_expiring( fake ) : #NEWLINE# #INDENT# 'Test that exchanging a code for an access token works.' #NEWLINE# with non_expiring_token_response ( fake ) : #NEWLINE# #INDENT# client = soundcloud . Client ( client_id = 'foo' , client_secret = 'bar' , redirect_uri = 'http://example.com/callback' ) #NEWLINE# token = client . exchange_token ( 'this-is-a-code' ) #NEWLINE# eq_ ( 'access-1234' , client . access_token ) #NEWLINE# eq_ ( 'non-expiring' , token . scope ) #NEWLINE# eq_ ( 'access-1234' , client . access_token )