#NEWLINE# @ patch ( 'onedrivesdk.HttpProvider' ) #NEWLINE# @ patch ( 'onedrivesdk.AuthProvider' ) #NEWLINE# def test_download( self , MockHttpProvider , MockAuthProvider ) : #NEWLINE# #INDENT# path = './myPath/myFile.txt' #NEWLINE# response = HttpResponse ( 200 , None , None ) #NEWLINE# instance = MockHttpProvider . return_value #NEWLINE# instance . download . return_value = response #NEWLINE# instance = MockAuthProvider . return_value #NEWLINE# instance . authenticate . return_value = 'blah' #NEWLINE# instance . authenticate_request . return_value = None #NEWLINE# http_provider = onedrivesdk . HttpProvider ( ) #NEWLINE# auth_provider = onedrivesdk . AuthProvider ( ) #NEWLINE# client = onedrivesdk . OneDriveClient ( 'onedriveurl/' , http_provider , client ) #NEWLINE# client . drives [ 'me' ] . items [ 'root' ] . children [ 'newFile.txt' ] . content . request ( ) . download ( path ) #NEWLINE# assert ( client . http_provider . download . call_args [ 0 ] [ 2 ] == path ) #NEWLINE# assert ( client . http_provider . download . call_args [ 0 ] [ 1 ] == 'onedriveurl/drives/me/items/root/children/newFile.txt/content' )