#NEWLINE# def test_share_view( self ) : #NEWLINE# #INDENT# 'Test the share view' #NEWLINE# profiler_patcher = mock . patch ( 'flaskext.gae_mini_profiler.profiler' , spec = True ) #NEWLINE# request_patcher = mock . patch ( 'flaskext.gae_mini_profiler.request' , spec = True ) #NEWLINE# profiler = profiler_patcher . start ( ) #NEWLINE# request = request_patcher . start ( ) #NEWLINE# try : #NEWLINE# #INDENT# from flaskext.gae_mini_profiler import GAEMiniProfiler #NEWLINE# request_id = mock . Sentinel ( ) #NEWLINE# request . args = { #NEWLINE# #INDENT# 'request_id' : request_id , #NEWLINE# #UNINDENT# } #NEWLINE# app = mock . Mock ( ) #NEWLINE# ext = GAEMiniProfiler ( app ) #NEWLINE# with mock . patch . object ( ext , '_render' ) as render : #NEWLINE# #INDENT# ext . _share_view ( ) #NEWLINE# #UNINDENT# profiler . RequestStats . get . assert_called_once_with ( request_id ) #NEWLINE# self . assertTrue ( 1 , render . call_count ) #NEWLINE# self . assertEquals ( request_id , render . call_args [ 0 ] [ 1 ] [ 'request_id' ] ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# request_patcher . stop ( ) #NEWLINE# profiler_patcher . stop ( )