xref: /unit/test/python/close/wsgi.py (revision 617)
1603Szelenkov@nginx.comclass application:
2603Szelenkov@nginx.com    def __init__(self, environ, start_response):
3603Szelenkov@nginx.com        self.environ = environ
4603Szelenkov@nginx.com        self.start = start_response
5603Szelenkov@nginx.com
6603Szelenkov@nginx.com    def __iter__(self):
7603Szelenkov@nginx.com        self.start('200', [(('Content-Length', '0'))])
8*617Szelenkov@nginx.com        yield b''
9603Szelenkov@nginx.com
10603Szelenkov@nginx.com    def close(self):
11603Szelenkov@nginx.com        self.environ['wsgi.errors'].write('Close called.')
12