summaryrefslogtreecommitdiffhomepage
path: root/test/python
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-03-12 13:47:43 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2020-03-12 13:47:43 +0000
commit1d752777674cacde1badc644102f393871aecfdc (patch)
tree31903725bd3d8c15187eafeaf0b9f904eb6428d2 /test/python
parent961674af4220ee2e769bb01ce9acd213ecaaa33c (diff)
downloadunit-1d752777674cacde1badc644102f393871aecfdc.tar.gz
unit-1d752777674cacde1badc644102f393871aecfdc.tar.bz2
Tests: round robin upstream tests.
Diffstat (limited to 'test/python')
-rw-r--r--test/python/upstreams/0/wsgi.py8
-rw-r--r--test/python/upstreams/1/wsgi.py8
-rw-r--r--test/python/upstreams/2/wsgi.py8
3 files changed, 24 insertions, 0 deletions
diff --git a/test/python/upstreams/0/wsgi.py b/test/python/upstreams/0/wsgi.py
new file mode 100644
index 00000000..2c88979b
--- /dev/null
+++ b/test/python/upstreams/0/wsgi.py
@@ -0,0 +1,8 @@
+import time
+
+def application(env, start_response):
+ delay = int(env.get('HTTP_X_DELAY', 0))
+
+ start_response('200', [('Content-Length', '0'), ('X-Upstream', '0')])
+ time.sleep(delay)
+ return []
diff --git a/test/python/upstreams/1/wsgi.py b/test/python/upstreams/1/wsgi.py
new file mode 100644
index 00000000..5077bdb1
--- /dev/null
+++ b/test/python/upstreams/1/wsgi.py
@@ -0,0 +1,8 @@
+import time
+
+def application(env, start_response):
+ delay = int(env.get('HTTP_X_DELAY', 0))
+
+ start_response('200', [('Content-Length', '0'), ('X-Upstream', '1')])
+ time.sleep(delay)
+ return []
diff --git a/test/python/upstreams/2/wsgi.py b/test/python/upstreams/2/wsgi.py
new file mode 100644
index 00000000..bb0ce797
--- /dev/null
+++ b/test/python/upstreams/2/wsgi.py
@@ -0,0 +1,8 @@
+import time
+
+def application(env, start_response):
+ delay = int(env.get('HTTP_X_DELAY', 0))
+
+ start_response('200', [('Content-Length', '0'), ('X-Upstream', '2')])
+ time.sleep(delay)
+ return []