Source

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

Full commit

from PyObjCTools.TestSupport import *
from AppKit import *

try:
    unicode
except NameError:
    unicode = str


try:
    long
except NameError:
    long = int

class TestNSInterfaceStyle (TestCase):
    def testConstants(self):
        self.assertEqual(NSNoInterfaceStyle, 0)
        self.assertEqual(NSNextStepInterfaceStyle, 1)
        self.assertEqual(NSWindows95InterfaceStyle, 2)
        self.assertEqual(NSMacintoshInterfaceStyle, 3)

        self.assertIsInstance(NSInterfaceStyleDefault, unicode)

    def testFunctions(self):
        v = NSInterfaceStyleForKey("button", None)
        self.assertIsInstance(v, (int, long))


if __name__ == "__main__":
    main()