pumazi/wsgi_intercept2 — Issue #16: 16 - wsgi_intercept can't handle functions that stream chunked encoding data infinitely 
Author: pumazi
Created: 2011-12-22 19:25:34+00:00
State: open

What steps will reproduce the problem?
1. Write a WSGI application that returns an iterator that streams infinitely.
2. Try to test the WSGI application.

What is the expected output?
It'd be great if it could give you an iterator.

What do you see instead?
It tries to buffer everything.

What version of the product are you using?
0.4

On what operating system?
Linux jjinux 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux

Please provide any additional information below.
A WSGI application can return an iterator. It knows how to output things using a chunked encoding. That's useful to stream a possibly infinite amount of data. My application is like that. Unfortunately, this is not currently supported by wsgi_intercept.

I ended up using WebOb to test my application:

request = webob.Request.blank('/')
response = request.get_response(server.Handler.handle)
assert response.app_iter.next() == "\n"
assert response.app_iter.next() == '{"test": "data"}\n'

Original link: http://code.google.com/p/wsgi-intercept/issues/detail?id=16