diff options
author | Robert Brewer <fumanchu@aminus.org> | 2007-10-16 17:54:16 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2007-10-16 17:54:16 +0000 |
commit | 4e157736e4476f3008a941e5661fa3321fb1d26c (patch) | |
tree | 879a84b451086d5645654ca24cf913bf2ae60632 /cherrypy/test/test.py | |
parent | edd77d527ad446afcb913311425cfae790acfa9d (diff) | |
download | cherrypy-git-4e157736e4476f3008a941e5661fa3321fb1d26c.tar.gz |
Made test.CommandLineParser shortopts/longopts into instance attributes for easier extension.
Diffstat (limited to 'cherrypy/test/test.py')
-rw-r--r-- | cherrypy/test/test.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cherrypy/test/test.py b/cherrypy/test/test.py index dd5f5849..fe6c545c 100644 --- a/cherrypy/test/test.py +++ b/cherrypy/test/test.py @@ -102,6 +102,10 @@ class CommandLineParser(object): basedir = None interactive = True + shortopts = [] + longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', '1.0', + 'ssl', 'help', 'basedir=', 'port=', 'server=', 'host='] + def __init__(self, available_tests, args=sys.argv[1:]): """Constructor to populate the TestHarness instance. @@ -112,12 +116,10 @@ class CommandLineParser(object): """ self.available_tests = available_tests - longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', - '1.0', 'ssl', 'help', - 'basedir=', 'port=', 'server=', 'host='] + longopts = self.longopts[:] longopts.extend(self.available_tests) try: - opts, args = getopt.getopt(args, "", longopts) + opts, args = getopt.getopt(args, self.shortopts, longopts) except getopt.GetoptError: # print help information and exit self.help() |