diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-06 17:18:32 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-06 17:18:32 (GMT) |
commit | 59bf738874d2582ca37e49c162a18ef20442177e (patch) | |
tree | fbb41d7a287694932f1e16338399ed36178924ff /Lib/test | |
parent | 6e7d711d2a54087051e215f85115528a346c25d1 (diff) | |
download | cpython-59bf738874d2582ca37e49c162a18ef20442177e.zip cpython-59bf738874d2582ca37e49c162a18ef20442177e.tar.gz cpython-59bf738874d2582ca37e49c162a18ef20442177e.tar.bz2 |
Merged revisions 87797 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87797 | antoine.pitrou | 2011-01-06 18:17:04 +0100 (jeu., 06 janv. 2011) | 4 lines
Issue #3839: wsgiref should not override a Content-Length header set by
the application. Initial patch by Clovis Fabricio.
........
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/test_wsgiref.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index ef38d77..3450163 100755 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -543,6 +543,11 @@ class HandlerTests(TestCase): s('200 OK',[]) return ['\u0442\u0435\u0441\u0442'.encode("utf-8")] + def trivial_app4(e,s): + # Simulate a response to a HEAD request + s('200 OK',[('Content-Length', '12345')]) + return [] + h = TestHandler() h.run(trivial_app1) self.assertEqual(h.stdout.getvalue(), @@ -566,10 +571,12 @@ class HandlerTests(TestCase): b'\r\n' b'\xd1\x82\xd0\xb5\xd1\x81\xd1\x82') - - - - + h = TestHandler() + h.run(trivial_app4) + self.assertEqual(h.stdout.getvalue(), + b'Status: 200 OK\r\n' + b'Content-Length: 12345\r\n' + b'\r\n') def testBasicErrorOutput(self): |