#NEWLINE# def test_basic_single_default_hook( self ) : #NEWLINE# #INDENT# _stdout = StringIO ( ) #NEWLINE# class RootController ( object ) : #NEWLINE# #INDENT# @ expose ( ) #NEWLINE# def index( self ) : #NEWLINE# #INDENT# return 'Hello, World!' #NEWLINE# #UNINDENT# #UNINDENT# app = TestApp ( make_app ( RootController ( ) , hooks = ( lambda : [ RequestViewerHook ( writer = _stdout ) ] ) ) ) #NEWLINE# response = app . get ( '/' ) #NEWLINE# out = _stdout . getvalue ( ) #NEWLINE# assert ( response . status_int == 200 ) #NEWLINE# assert ( response . body == b_ ( 'Hello, World!' ) ) #NEWLINE# assert ( 'path' in out ) #NEWLINE# assert ( 'method' in out ) #NEWLINE# assert ( 'status' in out ) #NEWLINE# assert ( 'method' in out ) #NEWLINE# assert ( 'params' in out ) #NEWLINE# assert ( 'hooks' in out ) #NEWLINE# assert ( '200 OK' in out ) #NEWLINE# assert ( "['RequestViewerHook']" in out ) #NEWLINE# assert ( '/' in out )