def testPolymorphParam1(self): strid = "test_id" title = "title" description = "description" polyaction = PolyAction(self.application, strid, title, description) polyaction.run(None) self.assertEqual(self._actionVal, 0) polyaction.setFunc(self._addParams) polyaction.run(5) self.assertEqual(self._actionVal, 5)
def testPolymorphParam1 (self): strid = "test_id" title = u"title" description = u"description" polyaction = PolyAction (Application, strid, title, description) polyaction.run(None) self.assertEqual (self._actionVal, 0) polyaction.setFunc (self._addParams) polyaction.run (5) self.assertEqual (self._actionVal, 5)
def testEmpty (self): strid = "test_id" title = u"title" description = u"description" hotkey = HotKey ("F1") polyaction = PolyAction (Application, strid, title, description) self.actionController.register (polyaction, hotkey) self.assertEqual (self.actionController.getAction (strid).title, title) self.assertEqual (self.actionController.getAction (strid).description, description) polyaction.run (None)
def testEmpty(self): strid = "test_id" title = "title" description = "description" hotkey = HotKey("F1") polyaction = PolyAction(self.application, strid, title, description) self.actionController.register(polyaction, hotkey) self.assertEqual(self.actionController.getAction(strid).title, title) self.assertEqual( self.actionController.getAction(strid).description, description) polyaction.run(None)
def testPolymorph(self): strid = "test_id" title = "title" description = "description" polyaction = PolyAction(self.application, strid, title, description) polyaction.run(None) self.assertEqual(self._actionVal, 0) polyaction.setFunc(self._addActionVal) polyaction.run(None) self.assertEqual(self._actionVal, 1) polyaction.run(None) self.assertEqual(self._actionVal, 2) self._actionVal = 0 polyaction.setFunc(self._addActionVal2) polyaction.run(0) self.assertEqual(self._actionVal, 2) polyaction.setFunc(None) polyaction.run(0) self.assertEqual(self._actionVal, 2)
def testPolymorph (self): strid = "test_id" title = u"title" description = u"description" polyaction = PolyAction (Application, strid, title, description) polyaction.run(None) self.assertEqual (self._actionVal, 0) polyaction.setFunc (self._addActionVal) polyaction.run(None) self.assertEqual (self._actionVal, 1) polyaction.run(None) self.assertEqual (self._actionVal, 2) self._actionVal = 0 polyaction.setFunc (self._addActionVal2) polyaction.run (0) self.assertEqual (self._actionVal, 2) polyaction.setFunc (None) polyaction.run (0) self.assertEqual (self._actionVal, 2)