#NEWLINE# @ mock . patch ( 'website.addons.dropbox.views.DropboxClient.metadata' ) #NEWLINE# def test_dropbox_folder_list_returns_error_if_invalid_path( self , mock_metadata ) : #NEWLINE# #INDENT# mock_response = mock . Mock ( ) #NEWLINE# mock_metadata . side_effect = ErrorResponse ( mock_response , body = 'File not found' ) #NEWLINE# url = self . project . api_url_for ( 'dropbox_folder_list' , folderId = '/fake_path' ) #NEWLINE# with mock . patch . object ( type ( self . node_settings ) , 'has_auth' , True ) : #NEWLINE# #INDENT# res = self . app . get ( url , auth = self . user . auth , expect_errors = True ) #NEWLINE# #UNINDENT# assert_equal ( mock_response . status_code , http . NOT_FOUND )