Пример #1
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 )
Пример #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'))
Пример #3
0
 def assertNotNone(self):
     """ControllerTest: Test instance not null"""
     controller = Controller('test')
     self.assertNotEqual(None, controller)
Пример #4
0
 def assertIController(self):
     """ControllerTest: Test instance implements IController"""
     controller = Controller('test')
     self.assertEqual(True, isinstance(controller, IController))