1
2from PyObjCTools.TestSupport import *
3from Quartz.QuartzCore import *
4
5class TestCAAnimationHelper (NSObject):
6    def animationDidStop_finished_(self, a, f): pass
7
8class TestCAAnimation (TestCase):
9    @min_os_level('10.5')
10    def testMethods(self):
11        self.assertResultIsBOOL(CAAnimation.shouldArchiveValueForKey_)
12        self.assertResultIsBOOL(CAAnimation.isRemovedOnCompletion)
13        self.assertArgIsBOOL(CAAnimation.setRemovedOnCompletion_, 0)
14
15        self.assertArgIsBOOL(TestCAAnimationHelper.animationDidStop_finished_, 1)
16
17        self.assertResultIsBOOL(CAPropertyAnimation.isAdditive)
18        self.assertArgIsBOOL(CAPropertyAnimation.setAdditive_, 0)
19
20        self.assertResultIsBOOL(CAPropertyAnimation.isCumulative)
21        self.assertArgIsBOOL(CAPropertyAnimation.setCumulative_, 0)
22
23    @min_os_level('10.5')
24    def testConstants10_5(self):
25        self.assertIsInstance(kCAAnimationLinear, unicode)
26        self.assertIsInstance(kCAAnimationDiscrete, unicode)
27        self.assertIsInstance(kCAAnimationPaced, unicode)
28
29        self.assertIsInstance(kCATransitionFade, unicode)
30        self.assertIsInstance(kCATransitionMoveIn, unicode)
31        self.assertIsInstance(kCATransitionPush, unicode)
32        self.assertIsInstance(kCATransitionReveal, unicode)
33        self.assertIsInstance(kCATransitionFromRight, unicode)
34        self.assertIsInstance(kCATransitionFromLeft, unicode)
35        self.assertIsInstance(kCATransitionFromTop, unicode)
36        self.assertIsInstance(kCATransitionFromBottom, unicode)
37
38        self.assertIsInstance(kCAAnimationRotateAuto, unicode)
39        self.assertIsInstance(kCAAnimationRotateAutoReverse, unicode)
40
41
42
43if __name__ == "__main__":
44    main()
45