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

Changeset 689

Show
Ignore:
Timestamp:
09/28/05 11:59:32
Author:
fumanchu
Message:

Fix for #327 (broken test due to missing setConfig).

Files:

Legend:

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

    r682 r689  
    184184CPTestRunner = webtest.TerseTestRunner(verbosity=2) 
    185185 
    186  
    187 def run_test_suite(moduleNames, server, conf): 
    188     """Run the given test modules using the given server and conf. 
    189      
    190     The server is started and stopped once, regardless of the number 
    191     of test modules. The config, however, is reset for each module. 
    192     """ 
     186def setConfig(conf): 
     187    """Set the config using a copy of conf.""" 
    193188    if isinstance(conf, basestring): 
    194189        # assume it's a filename 
     
    196191    else: 
    197192        cherrypy.config.update(conf.copy()) 
     193 
     194def run_test_suite(moduleNames, server, conf): 
     195    """Run the given test modules using the given server and conf. 
     196     
     197    The server is started and stopped once, regardless of the number 
     198    of test modules. The config, however, is reset for each module. 
     199    """ 
     200    setConfig(conf) 
    198201    startServer(server) 
    199202    for testmod in moduleNames: 
     
    201204        # because each module uses/overwrites cherrypy globals. 
    202205        cherrypy.config.reset() 
    203         if isinstance(conf, basestring): 
    204             cherrypy.config.update(file=conf) 
    205         else: 
    206             cherrypy.config.update(conf.copy()) 
     206        setConfig(conf) 
    207207        cherrypy._cputil._cpInitDefaultFilters() 
    208208         
     
    216216    if conf is None: 
    217217        conf = {} 
    218     if isinstance(conf, basestring): 
    219         # assume it's a filename 
    220         cherrypy.config.update(file=conf) 
    221     else: 
    222         cherrypy.config.update(conf.copy()) 
     218    setConfig(conf) 
    223219     
    224220    startServer(server) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets