#NEWLINE# @ httpretty . activate #NEWLINE# def _test__get_file_tree( self , addon_short_name ) : #NEWLINE# #INDENT# requests_made = [ ] #NEWLINE# def callback( request , uri , headers ) : #NEWLINE# #INDENT# path = request . querystring [ 'path' ] [ 0 ] #NEWLINE# requests_made . append ( path ) #NEWLINE# return ( 200 , headers , json . dumps ( self . RESP_MAP [ path ] ) ) #NEWLINE# #UNINDENT# for path in self . RESP_MAP . keys ( ) : #NEWLINE# #INDENT# url = waterbutler_url_for ( 'metadata' , provider = addon_short_name , path = path , node = self . src , user = self . user , view_only = True ) #NEWLINE# httpretty . register_uri ( httpretty . GET , url , body = callback , content_type = 'applcation/json' ) #NEWLINE# #UNINDENT# addon = self . src . get_or_add_addon ( addon_short_name , auth = self . auth ) #NEWLINE# root = { #NEWLINE# #INDENT# 'path' : '/' , #NEWLINE# 'name' : '' , #NEWLINE# 'kind' : 'folder' , #NEWLINE# #UNINDENT# } #NEWLINE# file_tree = addon . _get_file_tree ( root , self . user ) #NEWLINE# assert_equal ( FILE_TREE , file_tree ) #NEWLINE# assert_equal ( requests_made , [ '/' , '/qwerty' ] )