From 6ab203867b19fcbac6f6c1ef6c56475b94bdcd3d Mon Sep 17 00:00:00 2001 From: Patrick Carlisle Date: Wed, 17 Feb 2010 10:43:21 -0800 Subject: [PATCH] Update tests for Chunked-Body closing CRLF. --- tests/wsgi_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/wsgi_test.py b/tests/wsgi_test.py index df6e5b7..168dbd1 100644 --- a/tests/wsgi_test.py +++ b/tests/wsgi_test.py @@ -331,6 +331,9 @@ class TestHttpd(LimitedTestCase): fd.readline() # CRLF chunklen = int(fd.readline(), 16) self.assert_(chunks > 1) + response = fd.read() + # Require a CRLF to close the message body + self.assertEqual(response, '\r\n') def test_012_ssl_server(self): def wsgi_app(environ, start_response): @@ -788,8 +791,9 @@ class TestHttpd(LimitedTestCase): if h == '': break self.assert_('Transfer-Encoding: chunked' in ''.join(headers)) - # should only be one chunk of zero size - self.assertEqual(response, ['0', '']) + # should only be one chunk of zero size with two blank lines + # (one terminates the chunk, one terminates the body) + self.assertEqual(response, ['0', '', '']) if __name__ == '__main__':