Commit 31dd90d6 authored by Gerhard Weis's avatar Gerhard Weis

add failing test for #44. Publish IUnboundStreamIterator via publish_module

parent 5f2ba1ea
......@@ -447,6 +447,31 @@ class Test_publish_module(unittest.TestCase):
app_iter = self._callFUT(environ, start_response, _publish)
self.assertTrue(app_iter is body)
def test_response_is_unboundstream(self):
from ZPublisher.Iterators import IUnboundStreamIterator
from zope.interface import implements
class test_unboundstreamiterator:
implements(IUnboundStreamIterator)
data = "hello"
done = 0
def next(self):
if not self.done:
self.done = 1
return self.data
raise StopIteration
_response = DummyResponse()
_response._status = '200 OK'
body = _response.body = test_unboundstreamiterator()
environ = self._makeEnviron()
start_response = DummyCallable()
_publish = DummyCallable()
_publish._result = _response
app_iter = self._callFUT(environ, start_response, _publish)
self.assertTrue(app_iter is body)
def test_request_closed_when_tm_middleware_not_active(self):
environ = self._makeEnviron()
start_response = DummyCallable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment