Ticket #15018: test_for_ticket_15018.diff
File test_for_ticket_15018.diff, 862 bytes (added by , 14 years ago) |
---|
-
tests/regressiontests/requests/tests.py
129 129 # Read everything else. 130 130 self.assertEqual(stream.readline(), 'ijkl') 131 131 132 def test_limited_stream_ticket_15018(self): 133 stream = LimitedStream(StringIO('\nabc'), 3) 134 self.assertEqual(stream.readline(3), '\n') 135 self.assertEqual(stream.readline(1), 'a') 136 self.assertEqual(stream.readline(1), 'b') 137 # Hit stream limit 138 self.assertEqual(stream.readline(1), '') 139 132 140 def test_stream(self): 133 141 request = WSGIRequest({'REQUEST_METHOD': 'POST', 'wsgi.input': StringIO('name=value')}) 134 142 self.assertEqual(request.read(), 'name=value')