Commit b8312a98 authored by Ralf Schmitt's avatar Ralf Schmitt

add TestEmptyYield

--HG--
extra : transplant_source : %D3%23%3F%1ET%96%24%89%D7%D4z%C4%A9%BBv%7Ct%01%AB%2A
parent 0b53f811
......@@ -517,6 +517,23 @@ class TestError_after_start_response(TestError):
start_response('200 OK', [('Content-Type', 'text/plain')])
raise ExpectedException
class TestEmptyYield(TestCase):
@staticmethod
def application(env, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
yield ""
yield ""
def test_err(self):
fd = self.connect().makefile(bufsize=1)
fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n')
st, h, body = read_http(fd)
assert body==""
garbage = fd.read()
self.assert_(garbage=="", "got garbage: %r" % garbage)
class HTTPRequest(urllib2.Request):
"""Hack urllib2.Request to support PUT and DELETE methods."""
......
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