def testHasCommand(self):
        """ControllerTest: Test has_command()"""

        controller = Controller("test")
        controller.register_command("hasCommandTest", utils.controller.ControllerTestCommand)

        self.assertEqual(True, controller.has_command("hasCommandTest"))

        controller.remove_command("hasCommandTest")

        self.assertEqual(False, controller.has_command("hasCommandTest"))
Example #2
0
    def testHasCommand(self):
        """ControllerTest: Test has_command()"""

        controller = Controller('test')
        controller.register_command('hasCommandTest', utils.controller.ControllerTestCommand)

        self.assertEqual(True, controller.has_command('hasCommandTest'))

        controller.remove_command('hasCommandTest')

        self.assertEqual(False, controller.has_command('hasCommandTest'))
    def testRegisterAndExecuteCommand(self):
        """ControllerTest: Test register_command() and execute_command()"""
        controller = Controller("test")
        controller.register_command("ControllerTest", utils.controller.ControllerTestCommand)

        vo = utils.controller.ControllerTestVO(12)
        note = Notification("ControllerTest", vo)

        controller.execute_command(note)

        self.assertEqual(True, vo.result == 24)
Example #4
0
    def testRegisterAndExecuteCommand(self):
        """ControllerTest: Test register_command() and execute_command()"""
        controller = Controller('test')
        controller.register_command('ControllerTest', utils.controller.ControllerTestCommand)

        vo = utils.controller.ControllerTestVO(12)
        note = Notification('ControllerTest', vo)

        controller.execute_command(note)

        self.assertEqual(True, vo.result == 24 )