#NEWLINE# def test_post_cached_module( self ) : #NEWLINE# #INDENT# console . ConsoleRequestHandler . _modulename_to_shell_module = { #NEWLINE# #INDENT# 'default' : self . interactive_command_module , #NEWLINE# #UNINDENT# } #NEWLINE# request = webapp2 . Request . blank ( '' , POST = { #NEWLINE# #INDENT# 'code' : 'print 5+5' , #NEWLINE# 'module_name' : 'default' , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = webapp2 . Response ( ) #NEWLINE# handler = console . ConsoleRequestHandler ( request , response ) #NEWLINE# handler . dispatcher = self . dispatcher #NEWLINE# self . interactive_command_module . send_interactive_command ( 'print 5+5' ) . AndReturn ( '10\n' ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# handler . post ( ) #NEWLINE# self . mox . VerifyAll ( ) #NEWLINE# self . assertEqual ( 200 , response . status_int ) #NEWLINE# self . assertEqual ( '10\n' , self . body )