Пример #1
0
    def testHelp(self):
        cmd = YokadiCmd()
        for attr in dir(cmd):
            if not attr.startswith("do_"):
                continue

            yokadiCommand = attr[3:]
            try:
                # Execute the command, but redirect stdout and stderr to
                # /dev/null to avoid flooding the terminal
                with to_devnull(sys.stdout), to_devnull(sys.stderr):
                    # We use Cmd implementation of onecmd() because YokadiCmd
                    # overrides it to catch exceptions
                    Cmd.onecmd(cmd, "help " + yokadiCommand)
            except Exception:
                print("'help %s' failed" % yokadiCommand)
                raise
Пример #2
0
 def setUp(self):
     db.connectDatabase("", memoryDatabase=True)
     setDefaultConfig()
     self.session = db.getSession()
     tui.clearInputAnswers()
     self.cmd = YokadiCmd()
Пример #3
0
 def setUp(self):
     testutils.clearDatabase()
     tui.clearInputAnswers()
     self.cmd = YokadiCmd()