def testHasCommand(self): """ControllerTest: Test hasCommand()""" controller = puremvc.core.Controller.getInstance() controller.registerCommand('hasCommandTest', utils.controller.ControllerTestCommand) self.assertEqual(True, controller.hasCommand('hasCommandTest')) controller.removeCommand('hasCommandTest') self.assertEqual(False, controller.hasCommand('hasCommandTest'))
def testRegisterAndExecuteCommand(self): """ControllerTest: Test registerCommand() and executeCommand()""" controller = puremvc.core.Controller.getInstance() controller.registerCommand('ControllerTest', utils.controller.ControllerTestCommand) vo = utils.controller.ControllerTestVO(12) note = puremvc.patterns.observer.Notification('ControllerTest', vo) controller.executeCommand(note) self.assertEqual(True, vo.result == 24 )