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

Changeset 453

Show
Ignore:
Timestamp:
07/11/05 15:37:05
Author:
mikerobi
Message:

tests, fixed test_session_filter, it is not called from test.py, and must be run directly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_session_filter.py

    r444 r453  
    2626OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    2727""" 
     28 
     29testThreadCount = 3 
    2830 
    2931import unittest 
     
    9193class SessionFilterTest(unittest.TestCase): 
    9294 
    93     def __testSession(self, requestPath, iterations = 5, persistant=False): 
    94         #cherrypy.config.update({"sessionFilter.storageType": storageType}) 
     95    def __testSession(self, requestPath, iterations = 5, persistant=False, dummy = None): 
    9596         
    9697        helper.request(requestPath) 
     
    107108            self.assertEqual(cherrypy.response.body, str(n)) 
    108109 
    109     def __testCleanUp(self, storageType): 
    110         pass 
     110        return cookie 
     111 
     112    def testCleanUp(self, testPath = '/ram'): 
     113        cookies = [] 
     114        for n in xrange(5): 
     115            continue 
     116            cookies.append(self.__testSesssion(testPath, persistant=False)) 
     117 
     118        SessionFilter = cherrypy._cputil._cpDefaultFilterInstances['SessionFilter'] 
     119        sessionManagers = SessionFilter.sessionManagers 
    111120 
    112121    def __testCacheCleanUp(self, storageType): 
     
    124133    def testAnydbSessions(self): 
    125134        self.__testSession('/anydb', persistant=True) 
    126     
    127     def __testThreadSafety(self): 
    128         for z in range(30): 
    129             threading.Thread(target = self.__testSession, args = ('/ram')).start() 
     135     
     136    def testThreadSafety(self): 
     137        for z in range(testThreadCount): 
     138            threading.Thread(target = self.__testSession, args = ('/ram',)).start() 
    130139 
    131140    ''' 

Hosted by WebFaction

Log in as guest/cpguest to create tickets