Committing broken ssl wsgi test, in hopes that it can be fixed.

This commit is contained in:
Ryan Williams
2009-05-28 16:25:52 -07:00
parent 2bc2f1796b
commit 2f7158cd8c

View File

@@ -23,6 +23,7 @@ THE SOFTWARE.
"""
import cgi
import os
from eventlet import api
from eventlet import wsgi
@@ -264,5 +265,25 @@ class TestHttpd(tests.TestCase):
chunklen = int(fd.readline(), 16)
self.assert_(chunks > 1)
def test_012_ssl_server(self):
from eventlet import httpc
def wsgi_app(self, environ, start_response):
print "wsgi_app"
print environ['wsgi.input']
return [environ['wsgi.input'].read()]
certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')
sock = api.ssl_listener(('', 4201), certificate_file, private_key_file)
api.spawn(wsgi.server, sock, wsgi_app)
print "pre request"
result = httpc.post("https://localhost:4201/foo", "abc")
self.assertEquals(result, 'abc')
print "post request"
if __name__ == '__main__':
tests.main()