Tests: added Python threading tests.
This commit is contained in:
15
test/python/threads/wsgi.py
Normal file
15
test/python/threads/wsgi.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import time
|
||||
import threading
|
||||
|
||||
def application(environ, start_response):
|
||||
delay = float(environ.get('HTTP_X_DELAY', 0))
|
||||
|
||||
time.sleep(delay)
|
||||
|
||||
start_response('200', [
|
||||
('Content-Length', '0'),
|
||||
('Wsgi-Multithread', str(environ['wsgi.multithread'])),
|
||||
('X-Thread', str(threading.currentThread().ident))
|
||||
])
|
||||
|
||||
return []
|
||||
Reference in New Issue
Block a user