Robert Brewer avatar Robert Brewer committed 96109f9

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

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.