'Test that error in inner middleware leaves'

def test_multiple_reponse_mw_throw_exception(self):

    global context
    context['req_succeeded'] = []
    class RaiseStatusMiddleware(object, ):
        def process_response(self, req, resp, resource):
            raise falcon.HTTPStatus(falcon.HTTP_201)
    class RaiseErrorMiddleware(object, ):
        def process_response(self, req, resp, resource):
            raise falcon.HTTPError(falcon.HTTP_748)
    class ProcessResponseMiddleware(object, ):
        def process_response(self, req, resp, resource, req_succeeded):
            context['executed_methods'].append('process_response')
            context['req_succeeded'].append(req_succeeded)
    app = falcon.API(middleware=[ProcessResponseMiddleware(), RaiseErrorMiddleware(), ProcessResponseMiddleware(), RaiseStatusMiddleware(), ProcessResponseMiddleware()])
    app.add_route(TEST_ROUTE, MiddlewareClassResource())
    client = testing.TestClient(app)
    response = client.simulate_request(path=TEST_ROUTE)
    assert (response.status == falcon.HTTP_748)
    expected_methods = (['process_response'] * 3)
    assert (context['executed_methods'] == expected_methods)
    assert (context['req_succeeded'] == [True, False, False])
