Commit ff80ac28 authored by Tres Seaver's avatar Tres Seaver Committed by Gerhard Weis

Ensure stream iterator interfaces are related.

Also, add an assertion that the WSGIResponse gets its 'Content-Length'
header correctly set.
parent dcd81ee7
...@@ -13,7 +13,7 @@ class IUnboundStreamIterator(Interface): ...@@ -13,7 +13,7 @@ class IUnboundStreamIterator(Interface):
""" """
class IStreamIterator(Interface): class IStreamIterator(IUnboundStreamIterator):
""" """
An iterator with known length that can be published. An iterator with known length that can be published.
......
...@@ -184,6 +184,8 @@ class WSGIResponseTests(unittest.TestCase): ...@@ -184,6 +184,8 @@ class WSGIResponseTests(unittest.TestCase):
response.finalize() response.finalize()
self.assertTrue(body is response.body) self.assertTrue(body is response.body)
self.assertEqual(response._streaming, 0) self.assertEqual(response._streaming, 0)
self.assertEqual(response.getHeader('Content-Length'),
'%d' % len(test_streamiterator.data))
#def test___str__already_wrote_not_chunking(self): #def test___str__already_wrote_not_chunking(self):
# response = self._makeOne() # response = self._makeOne()
......
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