#NEWLINE# def test_handle_with_error_missing_error_handler( self ) : #NEWLINE# #INDENT# error_handler_file = os . path . join ( self . tmpdir , 'error.html' ) #NEWLINE# self . proxy = http_proxy . HttpProxy ( host = 'localhost' , port = 23456 , instance_died_unexpectedly = ( lambda : False ) , instance_logs_getter = get_instance_logs , error_handler_file = environ ) #NEWLINE# response = FakeHttpResponse ( 500 , 'Internal Server Error' , [ ( http_runtime_constants . ERROR_CODE_HEADER , '1' ) ] , '' ) #NEWLINE# login . get_user_info ( None ) . AndReturn ( ( '' , False , '' ) ) #NEWLINE# httplib . HTTPConnection . connect ( ) #NEWLINE# httplib . HTTPConnection . request ( 'GET' , '/get%20error' , None , { #NEWLINE# #INDENT# 'HEADER' : 'value' , #NEWLINE# http_runtime_constants . REQUEST_ID_HEADER : 'request id' , #NEWLINE# 'X-AppEngine-Country' : 'ZZ' , #NEWLINE# 'X-Appengine-User-Email' : '' , #NEWLINE# 'X-Appengine-User-Id' : '' , #NEWLINE# 'X-Appengine-User-Is-Admin' : '0' , #NEWLINE# 'X-Appengine-User-Nickname' : '' , #NEWLINE# 'X-Appengine-User-Organization' : '' , #NEWLINE# 'X-APPENGINE-DEV-SCRIPT' : 'get.py' , #NEWLINE# 'X-APPENGINE-SERVER-NAME' : 'localhost' , #NEWLINE# 'X-APPENGINE-SERVER-PORT' : '8080' , #NEWLINE# 'X-APPENGINE-SERVER-PROTOCOL' : 'HTTP/1.1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# httplib . HTTPConnection . getresponse ( ) . AndReturn ( response ) #NEWLINE# httplib . HTTPConnection . close ( ) #NEWLINE# environ = { #NEWLINE# #INDENT# 'HTTP_HEADER' : 'value' , #NEWLINE# 'PATH_INFO' : '/get error' , #NEWLINE# 'QUERY_STRING' : '' , #NEWLINE# 'HTTP_X_APPENGINE_USER_ID' : '123' , #NEWLINE# 'SERVER_NAME' : 'localhost' , #NEWLINE# 'SERVER_PORT' : '8080' , #NEWLINE# 'SERVER_PROTOCOL' : 'HTTP/1.1' , #NEWLINE# #UNINDENT# } #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# expected_headers = { #NEWLINE# #INDENT# 'Content-Type' : 'text/html' , #NEWLINE# 'Content-Length' : '28' , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertResponse ( '500 Internal Server Error' , expected_headers , 'Failed to load error handler' , self . proxy . handle , environ , url_map = self . url_map , match = re . match ( self . url_map . url , '/get%20error' ) , request_id = 'request id' , request_type = instance . NORMAL_REQUEST ) #NEWLINE# self . mox . VerifyAll ( )