comparison example/example.py @ 287:1cd23003e8d5

refactoring, but something went wrong with comments
author catherine@bothari
date Mon, 19 Oct 2009 18:00:26 -0400
parents 5147fa4166b0
children cd12e4e0fa17
comparison
equal deleted inserted replaced
286:3c4ba65cb303 287:1cd23003e8d5
28 # initialized with a non-standard output destination 28 # initialized with a non-standard output destination
29 29
30 do_say = do_speak # now "say" is a synonym for "speak" 30 do_say = do_speak # now "say" is a synonym for "speak"
31 do_orate = do_speak # another synonym, but this one takes multi-line input 31 do_orate = do_speak # another synonym, but this one takes multi-line input
32 32
33 c = CmdLineApp()
34
33 class TestMyAppCase(Cmd2TestCase): 35 class TestMyAppCase(Cmd2TestCase):
34 CmdApp = CmdLineApp 36 CmdApp = CmdLineApp
35 parser = optparse.OptionParser() 37 parser = optparse.OptionParser()
36 parser.add_option('-t', '--test', dest='test', action="store_true", 38 parser.add_option('-t', '--test', dest='test', action="store_true",
37 help='Test against transcript(s) in FILE (wildcards OK)') 39 help='Test against transcript(s) in FILE (wildcards OK)')
39 if callopts.test: 41 if callopts.test:
40 CmdLineApp.testfiles = callargs 42 CmdLineApp.testfiles = callargs
41 sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main() 43 sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main()
42 unittest.main() 44 unittest.main()
43 else: 45 else:
44 CmdLineApp().cmdloop() 46 pass
47 #CmdLineApp().cmdloop()
48