Commits

Robert Brewer committed 96109f9

So close. test_session --ssl errors are almost gone (now that the ''client'' sockets aren't being shared between threads).

  • Participants
  • Parent commits 798e0e0
  • Branches 598-sendall

Comments (0)

Files changed (1)

cherrypy/test/test_session.py

 from cherrypy.test import test
 test.prefer_parent_path()
 
+import httplib
 import os
 localDir = os.path.dirname(__file__)
 import sys
         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