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    def testMethods(self):
10        self.failUnlessResultIsBOOL(CAAnimation.shouldArchiveValueForKey_)
11        self.failUnlessResultIsBOOL(CAAnimation.isRemovedOnCompletion)
12        self.failUnlessArgIsBOOL(CAAnimation.setRemovedOnCompletion_, 0)
13
14        self.failUnlessArgIsBOOL(TestCAAnimationHelper.animationDidStop_finished_, 1)
15
16        self.failUnlessResultIsBOOL(CAPropertyAnimation.isAdditive)
17        self.failUnlessArgIsBOOL(CAPropertyAnimation.setAdditive_, 0)
18
19        self.failUnlessResultIsBOOL(CAPropertyAnimation.isCumulative)
20        self.failUnlessArgIsBOOL(CAPropertyAnimation.setCumulative_, 0)
21
22    @min_os_level('10.5')
23    def testConstants10_5(self):
24        self.failUnlessIsInstance(kCAAnimationLinear, unicode)
25        self.failUnlessIsInstance(kCAAnimationDiscrete, unicode)
26        self.failUnlessIsInstance(kCAAnimationPaced, unicode)
27
28        self.failUnlessIsInstance(kCATransitionFade, unicode)
29        self.failUnlessIsInstance(kCATransitionMoveIn, unicode)
30        self.failUnlessIsInstance(kCATransitionPush, unicode)
31        self.failUnlessIsInstance(kCATransitionReveal, unicode)
32        self.failUnlessIsInstance(kCATransitionFromRight, unicode)
33        self.failUnlessIsInstance(kCATransitionFromLeft, unicode)
34        self.failUnlessIsInstance(kCATransitionFromTop, unicode)
35        self.failUnlessIsInstance(kCATransitionFromBottom, unicode)
36
37    def testConstants(self):
38        self.failUnlessIsInstance(kCAAnimationRotateAuto, unicode)
39        self.failUnlessIsInstance(kCAAnimationRotateAutoReverse, unicode)
40
41
42
43if __name__ == "__main__":
44    main()
45