def test_interval_action_action(self):
     a = ac.Action()
     b = ac.IntervalAction()
     b.duration = 3.0
     res = b + a
     assert isinstance(res, ac.Action)
     assert not isinstance(res, ac.IntervalAction)
예제 #2
0
 def test_remove_action(self):
     node = CocosNode()
     self.assertTrue(len(node.actions) == 0)
     action = ac.Action()
     a_copy = node.do(action)
     self.assertTrue(len(node.actions) == 1)
     node.remove_action(a_copy)
     dt = 0.1
     node._step(
         dt)  # needed to complete delete, will traceback if remove failed
     self.assertTrue(len(node.actions) == 0)
 def test_instant_action_action(self):
     a = ac.Action()
     b = ac.InstantAction()
     res = b + a
     assert isinstance(res, ac.Action)
     assert not isinstance(res, ac.IntervalAction)