diff example/example.py @ 259:5147fa4166b0

multiple transcript tests working - sinister BASH trick defeated
author Catherine Devlin <catherine.devlin@gmail.com>
date Thu, 02 Apr 2009 18:07:04 -0400
parents 7a98d7f2da30
children 1cd23003e8d5
line wrap: on
line diff
--- a/example/example.py	Thu Apr 02 17:22:02 2009 -0400
+++ b/example/example.py	Thu Apr 02 18:07:04 2009 -0400
@@ -32,18 +32,12 @@
 
 class TestMyAppCase(Cmd2TestCase):
     CmdApp = CmdLineApp
-import logging
-logging.basicConfig(level=logging.DEBUG,
-                    filename='exlog.txt',
-                    filemode='w')
 parser = optparse.OptionParser()
-parser.add_option('-t', '--test', dest='test', metavar='FILE', 
-                  help='''Test against transcript(s) in FILE (wildcards OK)''')                  
+parser.add_option('-t', '--test', dest='test', action="store_true", 
+                  help='Test against transcript(s) in FILE (wildcards OK)')
 (callopts, callargs) = parser.parse_args()
-logging.error(callopts)
 if callopts.test:
-    CmdLineApp.testfile = callopts.test
-    logging.error(CmdLineApp.testfile)
+    CmdLineApp.testfiles = callargs
     sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main()
     unittest.main()
 else: