|
|
|
@ -580,9 +580,19 @@ def test_request_preprocessing_early_return():
|
|
|
|
|
evts = [] |
|
|
|
|
|
|
|
|
|
@app.before_request |
|
|
|
|
def before_request(): |
|
|
|
|
def before_request1(): |
|
|
|
|
evts.append(1) |
|
|
|
|
|
|
|
|
|
@app.before_request |
|
|
|
|
def before_request2(): |
|
|
|
|
evts.append(2) |
|
|
|
|
return "hello" |
|
|
|
|
|
|
|
|
|
@app.before_request |
|
|
|
|
def before_request3(): |
|
|
|
|
evts.append(3) |
|
|
|
|
return "bye" |
|
|
|
|
|
|
|
|
|
@app.route('/') |
|
|
|
|
def index(): |
|
|
|
|
evts.append('index') |
|
|
|
@ -590,7 +600,7 @@ def test_request_preprocessing_early_return():
|
|
|
|
|
|
|
|
|
|
rv = app.test_client().get('/').data.strip() |
|
|
|
|
assert rv == b'hello' |
|
|
|
|
assert not evts |
|
|
|
|
assert evts == [1, 2] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_after_request_processing(): |
|
|
|
|