Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1913

Show
Ignore:
Timestamp:
03/10/08 01:37:21
Author:
fumanchu
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/598-sendall/cherrypy/test/test_session.py

    r1868 r1913  
    22test.prefer_parent_path() 
    33 
     4import httplib 
    45import os 
    56localDir = os.path.dirname(__file__) 
     
    190191         
    191192        def request(index): 
     193            if self.scheme == 'https': 
     194                c = httplib.HTTPSConnection('127.0.0.1:%s' % self.PORT) 
     195            else: 
     196                c = httplib.HTTPConnection('127.0.0.1:%s' % self.PORT) 
    192197            for i in xrange(request_count): 
    193                 self.getPage("/", cookies) 
     198                c.putrequest('GET', '/') 
     199                for k, v in cookies: 
     200                    c.putheader(k, v) 
     201                c.endheaders() 
     202                response = c.getresponse() 
     203                self.assertEqual(response.status, 200) 
     204                body = response.read() 
     205                self.failUnless(body.isdigit()) 
    194206                # Uncomment the following line to prove threads overlap. 
    195207##                print index, 
    196             data_dict[index] = v = int(self.body
     208            data_dict[index] = max(data_dict[index], int(body)
    197209         
    198210        # Start <request_count> requests from each of 

Hosted by WebFaction

Log in as guest/cpguest to create tickets