summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wsgiref.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-01-06 17:19:05 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-01-06 17:19:05 (GMT)
commit77c1b382b76ba90acc570a4194521d6bd4425bac (patch)
treefad679c28e1bbdabf36efb783b6bbe427c71fc9e /Lib/test/test_wsgiref.py
parent9f41bb325b4f5db695d1ea25649d1fd1e809b2bf (diff)
downloadcpython-77c1b382b76ba90acc570a4194521d6bd4425bac.zip
cpython-77c1b382b76ba90acc570a4194521d6bd4425bac.tar.gz
cpython-77c1b382b76ba90acc570a4194521d6bd4425bac.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/test_wsgiref.py')
-rw-r--r--Lib/test/test_wsgiref.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index 5866efc..45ca620 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -481,6 +481,11 @@ class HandlerTests(TestCase):
s('200 OK',[])(e['wsgi.url_scheme'])
return []
+ 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(),
@@ -497,10 +502,12 @@ class HandlerTests(TestCase):
"http")
-
-
-
-
+ 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):