PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/pyobjc-framework-Cocoa/PyObjCTest/test_nsscreen.py

https://bitbucket.org/ronaldoussoren/pyobjc/
Python | 28 lines | 22 code | 6 blank | 0 comment | 1 complexity | 428e97eb2e7fc17512e35039b7daf095 MD5 | raw file
 1
 2from PyObjCTools.TestSupport import *
 3from AppKit import *
 4
 5class TestNSScreen (TestCase):
 6    def testMethods(self):
 7        m = NSScreen.supportedWindowDepths.__metadata__()
 8        self.assertTrue(m['retval']['c_array_delimited_by_null'])
 9
10    @min_os_level('10.6')
11    def testConstants10_6(self):
12        self.assertIsInstance(NSScreenColorSpaceDidChangeNotification, unicode)
13
14    @min_os_level('10.7')
15    def testMethods10_7(self):
16        self.assertResultHasType(NSScreen.convertRectToBacking_, NSRect.__typestr__)
17        self.assertArgHasType(NSScreen.convertRectToBacking_, 0, NSRect.__typestr__)
18        self.assertResultHasType(NSScreen.convertRectFromBacking_, NSRect.__typestr__)
19        self.assertArgHasType(NSScreen.convertRectFromBacking_, 0, NSRect.__typestr__)
20        self.assertResultHasType(NSScreen.backingAlignedRect_options_, NSRect.__typestr__)
21        self.assertArgHasType(NSScreen.backingAlignedRect_options_, 0, NSRect.__typestr__)
22
23    @min_os_level('10.9')
24    def testMethods10_9(self):
25        self.assertResultIsBOOL(NSScreen.screensHaveSeparateSpaces)
26
27if __name__ == "__main__":
28    main()