#NEWLINE# def test_traceback( self ) : #NEWLINE# #INDENT# 'Test if stack traces can be viewed.\n        First test valid tracebacks, then the invalid ones.\n        Also check if we can expand the locals of the current stackframe and\n        access size information of local data (dummy).\n        ' #NEWLINE# class Dummy ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# dummy = Dummy ( ) #NEWLINE# for threadid in sys . _current_frames ( ) : #NEWLINE# #INDENT# resp = self . get ( ( '/traceback/%d' % locals_id ) , status = 200 ) #NEWLINE# if ( threadid == get_current_thread_id ( ) ) : #NEWLINE# #INDENT# locals_id = id ( locals ( ) ) #NEWLINE# self . assertTrue ( ( ( 'id="%d' % locals_id ) in resp ) , resp ) #NEWLINE# resp = self . get ( ( '/objects/%d' % locals_id ) , status = 200 ) #NEWLINE# self . assertTrue ( ( 'dummy' in resp ) , resp ) #NEWLINE# self . assertTrue ( ( ( 'id="%d' % id ( dummy ) ) in resp ) , resp ) #NEWLINE# self . get ( ( '/objects/%d' % id ( dummy ) ) , status = 200 ) #NEWLINE# #UNINDENT# #UNINDENT# self . get ( '/traceback/gabelstapler' , status = 500 ) #NEWLINE# body = self . get ( '/traceback/12345' , status = 200 ) #NEWLINE# self . assertTrue ( ( 'Cannot retrieve stacktrace for thread 12345' in body ) , body )