bazarr/libs/waitress/tests/fixtureapps/sleepy.py

15 lines
362 B
Python
Raw Normal View History

import time
def app(environ, start_response): # pragma: no cover
if environ['PATH_INFO'] == '/sleepy':
time.sleep(2)
body = b'sleepy returned'
else:
body = b'notsleepy returned'
cl = str(len(body))
start_response(
'200 OK',
[('Content-Length', cl), ('Content-Type', 'text/plain')]
)
return [body]