Commit 6b3c1bea authored by Denis Bilenko's avatar Denis Bilenko

for the known failures in test__wsgi.py, print a warning instead of raising an exception

parent 260af574
......@@ -40,6 +40,7 @@ CONTENT_LENGTH = 'Content-Length'
CONN_ABORTED_ERRORS = []
server_implements_chunked = True
server_supports_pipeline = True
server_implements_100continue = True
DEBUG = '-v' in sys.argv
try:
......@@ -759,7 +760,14 @@ class ChunkedInputTests(TestCase):
fd = self.connect().makefile(bufsize=1)
fd.write(req)
read_http(fd, body="pong")
try:
read_http(fd, body="pong")
except AssertionError, ex:
if str(ex).startswith('Unexpected code: 400'):
if not server_implements_chunked:
print 'ChunkedNotImplementedWarning'
return
raise
self.ping(fd)
......@@ -812,7 +820,15 @@ class Expect100ContinueTests(TestCase):
fd = self.connect().makefile(bufsize=1)
fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 1025\r\nExpect: 100-continue\r\n\r\n')
read_http(fd, code=417, body="failure")
try:
read_http(fd, code=417, body="failure")
except AssertionError, ex:
if str(ex).startswith('Unexpected code: 400'):
if not server_implements_100continue:
print '100ContinueNotImplementedWarning'
return
raise
fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 7\r\nExpect: 100-continue\r\n\r\ntesting')
read_http(fd, code=100)
......
......@@ -6,6 +6,7 @@ from test__pywsgi import *
del TestHttps
test__pywsgi.server_implements_chunked = False
test__pywsgi.server_supports_pipeline = gevent.core.get_version()[1] == '2'
test__pywsgi.server_implements_100continue = False
TestCase.get_wsgi_module = lambda *args: wsgi
......
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