class TestArgumentParser(unittest.TestCase):
    def setUp(self):
        self.tkinterParser = ArgumentParser(TurtleDrawer())
        self.source = ['-c', '-e', '-t', '-k', '-g']

    def test_parse(self):
        raised = False
        try:
            self.tkinterParser.parse(self.source)
        except:
            raised = True
        self.assertFalse(raised, "Error Raised")
示例#2
0
    def go(self):
        result = ArgumentParser.parse(self, '')

        if result == 'g':
            print('graphics')
        elif result == 't':
            TurtlePrompt().cmdloop()
        elif result == 'k':
            TkinterDrawer().start()
        elif result == 'e':
            exit()
        else:
            print('graphics')
 def go(self):
     result = ArgumentParser.parse(self, '')
     if result == 'g':
         print('graphics')
         self.results.writeToFile("Graphics")
     elif result == 't':
         self.results.writeToFile("Running Turtle Command")
         TurtlePrompt().cmdloop()
     elif result == 'k':
         self.results.writeToFile("Running TKInter Drawer")
         TKinterDrawerPackage().start()
     elif result == 'e':
         self.results.writeToFile("Exiting program")
         exit()
     else:
         self.results.writeToFile(("Graphics from else as "
                                   "arguments were wrong"))
         print('graphics')