def test_raise_status_runs_process_response(self):
""" Make sure process_response still runs """
class TestMiddleware:
def process_response(self, req, resp, response):
resp.status = falcon.HTTP_200
resp.set_header('X-Failed', 'False')
resp.body = 'Pass'
app = falcon.API(middleware=TestMiddleware())
app.add_route('/status', TestHookResource())
client = testing.TestClient(app)
response = client.simulate_request(path='/status', method='GET')
assert response.status == falcon.HTTP_200
assert response.headers['x-failed'] == 'False'
assert response.text == 'Pass'
评论列表
文章目录