Tests: Python targets.

This commit is contained in:
Oisin Canty
2021-05-20 13:03:12 +00:00
parent f60389a782
commit e50bb120e2
7 changed files with 295 additions and 32 deletions

View File

@@ -0,0 +1,54 @@
async def application_201(scope, receive, send):
assert scope['type'] == 'http'
await send(
{
'type': 'http.response.start',
'status': 201,
'headers': [(b'content-length', b'0')],
}
)
async def application_200(scope, receive, send):
assert scope['type'] == 'http'
await send(
{
'type': 'http.response.start',
'status': 200,
'headers': [(b'content-length', b'0')],
}
)
def legacy_application_200(scope):
assert scope['type'] == 'http'
return legacy_app_http_200
async def legacy_app_http_200(receive, send):
await send(
{
'type': 'http.response.start',
'status': 200,
'headers': [(b'content-length', b'0')],
}
)
def legacy_application_201(scope, receive=None, send=None):
assert scope['type'] == 'http'
return legacy_app_http_201
async def legacy_app_http_201(receive, send):
await send(
{
'type': 'http.response.start',
'status': 201,
'headers': [(b'content-length', b'0')],
}
)

View File

@@ -0,0 +1,8 @@
def wsgi_target_a(env, start_response):
start_response('200', [('Content-Length', '1')])
return [b'1']
def wsgi_target_b(env, start_response):
start_response('200', [('Content-Length', '1')])
return [b'2']