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