예제 #1
0
    def testInvalidCommand(self):

        cli = CLI()

        # Check for incorrect command
        with self.assertRaises(ClindException):

            cli.processCommand("not a command")
예제 #2
0
    def testName(self):

        cli = CLI()

        name = cli.processCommand("name")

        # Check that name command returns a string with space
        self.assertTrue(isinstance(name, str))
        self.assertTrue(" " in name)
예제 #3
0
    def testRoll(self):

        cli = CLI()

        # Check roll command
        for i in range(100):

            r = cli.processCommand("roll 1d20")

            self.assertTrue(1 <= r <= 20)