hurl/integration/tests_ok/delay.py

21 lines
328 B
Python
Raw Normal View History

2023-09-01 09:47:05 +03:00
from app import app
from datetime import datetime
2023-09-13 15:40:04 +03:00
last = None
2023-09-01 09:47:05 +03:00
@app.route("/delay-init")
def delay_init():
2023-09-13 15:40:04 +03:00
global last
last = datetime.now()
2023-09-01 09:47:05 +03:00
return ""
@app.route("/delay")
def delay():
2023-09-13 15:40:04 +03:00
global last
diff = (datetime.now() - last).total_seconds()
2023-09-01 09:47:05 +03:00
assert diff > 1
2023-09-13 15:40:04 +03:00
last = datetime.now()
2023-09-01 09:47:05 +03:00
return ""