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

Changeset 1751

Show
Ignore:
Timestamp:
10/16/07 12:54:16
Author:
fumanchu
Message:

Made test.CommandLineParser? shortopts/longopts into instance attributes for easier extension.

Files:

Legend:

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

    r1741 r1751  
    103103    interactive = True 
    104104     
     105    shortopts = [] 
     106    longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', '1.0', 
     107                'ssl', 'help', 'basedir=', 'port=', 'server=', 'host='] 
     108     
    105109    def __init__(self, available_tests, args=sys.argv[1:]): 
    106110        """Constructor to populate the TestHarness instance. 
     
    113117        self.available_tests = available_tests 
    114118         
    115         longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', 
    116                     '1.0', 'ssl', 'help', 
    117                     'basedir=', 'port=', 'server=', 'host='] 
     119        longopts = self.longopts[:] 
    118120        longopts.extend(self.available_tests) 
    119121        try: 
    120             opts, args = getopt.getopt(args, "", longopts) 
     122            opts, args = getopt.getopt(args, self.shortopts, longopts) 
    121123        except getopt.GetoptError: 
    122124            # print help information and exit 

Hosted by WebFaction

Log in as guest/cpguest to create tickets