xref: /unit/test/python/targets/asgi.py (revision 1873:d0cc4fd78d43)
1*1873So.canty@f5.comasync def application_201(scope, receive, send):
2*1873So.canty@f5.com    assert scope['type'] == 'http'
3*1873So.canty@f5.com
4*1873So.canty@f5.com    await send(
5*1873So.canty@f5.com        {
6*1873So.canty@f5.com            'type': 'http.response.start',
7*1873So.canty@f5.com            'status': 201,
8*1873So.canty@f5.com            'headers': [(b'content-length', b'0')],
9*1873So.canty@f5.com        }
10*1873So.canty@f5.com    )
11*1873So.canty@f5.com
12*1873So.canty@f5.com
13*1873So.canty@f5.comasync def application_200(scope, receive, send):
14*1873So.canty@f5.com    assert scope['type'] == 'http'
15*1873So.canty@f5.com
16*1873So.canty@f5.com    await send(
17*1873So.canty@f5.com        {
18*1873So.canty@f5.com            'type': 'http.response.start',
19*1873So.canty@f5.com            'status': 200,
20*1873So.canty@f5.com            'headers': [(b'content-length', b'0')],
21*1873So.canty@f5.com        }
22*1873So.canty@f5.com    )
23*1873So.canty@f5.com
24*1873So.canty@f5.com
25*1873So.canty@f5.comdef legacy_application_200(scope):
26*1873So.canty@f5.com    assert scope['type'] == 'http'
27*1873So.canty@f5.com
28*1873So.canty@f5.com    return legacy_app_http_200
29*1873So.canty@f5.com
30*1873So.canty@f5.com
31*1873So.canty@f5.comasync def legacy_app_http_200(receive, send):
32*1873So.canty@f5.com    await send(
33*1873So.canty@f5.com        {
34*1873So.canty@f5.com            'type': 'http.response.start',
35*1873So.canty@f5.com            'status': 200,
36*1873So.canty@f5.com            'headers': [(b'content-length', b'0')],
37*1873So.canty@f5.com        }
38*1873So.canty@f5.com    )
39*1873So.canty@f5.com
40*1873So.canty@f5.com
41*1873So.canty@f5.comdef legacy_application_201(scope, receive=None, send=None):
42*1873So.canty@f5.com    assert scope['type'] == 'http'
43*1873So.canty@f5.com
44*1873So.canty@f5.com    return legacy_app_http_201
45*1873So.canty@f5.com
46*1873So.canty@f5.com
47*1873So.canty@f5.comasync def legacy_app_http_201(receive, send):
48*1873So.canty@f5.com    await send(
49*1873So.canty@f5.com        {
50*1873So.canty@f5.com            'type': 'http.response.start',
51*1873So.canty@f5.com            'status': 201,
52*1873So.canty@f5.com            'headers': [(b'content-length', b'0')],
53*1873So.canty@f5.com        }
54*1873So.canty@f5.com    )
55