1
2from PyObjCTools.TestSupport import *
3from WebKit import *
4import Cocoa
5
6try:
7    import Quartz
8except ImportError:
9    Quartz = None
10
11class TestCarbonUtils (TestCase):
12    @onlyOn32Bit
13    def testFunctions(self):
14        if Quartz is None:
15            self.fail("Quartz is not installed")
16
17        WebInitForCarbon()
18
19        #img = NSImage.imageNamed_('NSHelpCursor')
20        img = NSImage.imageNamed_(Cocoa.NSImageNameUserAccounts)
21        self.assertIsInstance(img, NSImage)
22
23        ref = WebConvertNSImageToCGImageRef(img)
24        if ref is not None:
25            self.assertIsInstance(ref, Quartz.CGImageRef)
26
27if __name__ == "__main__":
28    main()
29