diff options
author | Robert Brewer <fumanchu@aminus.org> | 2008-03-12 06:39:38 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2008-03-12 06:39:38 +0000 |
commit | bc44253aaa88632796c94490254420865bf82d09 (patch) | |
tree | 383e89afea911ba4a928f3e28733e6b3e98c1e5c /cherrypy/test/test_session.py | |
parent | d6f2fe3b1ecb02cafd98bf1ab2dfa12c7021bc5c (diff) | |
download | cherrypy-git-bc44253aaa88632796c94490254420865bf82d09.tar.gz |
Merging the 598-sendall branch. This fixes #598, #783, and perhaps #589.
Diffstat (limited to 'cherrypy/test/test_session.py')
-rwxr-xr-x | cherrypy/test/test_session.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cherrypy/test/test_session.py b/cherrypy/test/test_session.py index dc9057fe..22581b94 100755 --- a/cherrypy/test/test_session.py +++ b/cherrypy/test/test_session.py @@ -1,6 +1,7 @@ from cherrypy.test import test test.prefer_parent_path() +import httplib import os localDir = os.path.dirname(__file__) import sys @@ -189,11 +190,22 @@ class SessionTest(helper.CPWebCase): data_dict = {} def request(index): + if self.scheme == 'https': + c = httplib.HTTPSConnection('127.0.0.1:%s' % self.PORT) + else: + c = httplib.HTTPConnection('127.0.0.1:%s' % self.PORT) for i in xrange(request_count): - self.getPage("/", cookies) + c.putrequest('GET', '/') + for k, v in cookies: + c.putheader(k, v) + c.endheaders() + response = c.getresponse() + self.assertEqual(response.status, 200) + body = response.read() + self.failUnless(body.isdigit()) # Uncomment the following line to prove threads overlap. ## print index, - data_dict[index] = v = int(self.body) + data_dict[index] = max(data_dict[index], int(body)) # Start <request_count> requests from each of # <client_thread_count> concurrent clients |