summaryrefslogtreecommitdiffhomepage
path: root/test/python/legacy
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/python/legacy/asgi.py13
-rw-r--r--test/python/legacy_force/asgi.py17
2 files changed, 30 insertions, 0 deletions
diff --git a/test/python/legacy/asgi.py b/test/python/legacy/asgi.py
new file mode 100644
index 00000000..f065d026
--- /dev/null
+++ b/test/python/legacy/asgi.py
@@ -0,0 +1,13 @@
+def application(scope):
+ assert scope['type'] == 'http'
+
+ return app_http
+
+async def app_http(receive, send):
+ await send({
+ 'type': 'http.response.start',
+ 'status': 200,
+ 'headers': [
+ (b'content-length', b'0'),
+ ]
+ })
diff --git a/test/python/legacy_force/asgi.py b/test/python/legacy_force/asgi.py
new file mode 100644
index 00000000..2e5859f2
--- /dev/null
+++ b/test/python/legacy_force/asgi.py
@@ -0,0 +1,17 @@
+def application(scope, receive=None, send=None):
+ assert scope['type'] == 'http'
+
+ if receive == None and send == None:
+ return app_http
+
+ else:
+ return app_http(receive, send)
+
+async def app_http(receive, send):
+ await send({
+ 'type': 'http.response.start',
+ 'status': 200,
+ 'headers': [
+ (b'content-length', b'0'),
+ ]
+ })