pyobjc / pyobjc-framework-InputMethodKit / PyObjCTest /

Some simple tests to check that the framework is properly wrapped.
import objc
import unittest
import InputMethodKit

except NameError:
    unicode = str

except NameError:
    long = int

class TestInputMethodKit (unittest.TestCase):
    def testClasses(self):

        self.assert_( hasattr(InputMethodKit, 'IMKInputController') )
        self.assert_( isinstance(InputMethodKit.IMKInputController, objc.objc_class) )

        # 10.5
        self.assert_( hasattr(InputMethodKit, 'IMKCandidates') )
        self.assert_( isinstance(InputMethodKit.IMKCandidates, objc.objc_class) )
    def testValues(self):
        self.assert_( hasattr(InputMethodKit, 'kIMKScrollingGridCandidatePanel') )
        self.assert_( isinstance(InputMethodKit.kIMKScrollingGridCandidatePanel, (int, long)) )
        self.assertEquals(InputMethodKit.kIMKScrollingGridCandidatePanel, 2)

    def testVariables(self):
        self.assert_( hasattr(InputMethodKit, 'IMKCandidatesOpacityAttributeName') )
        self.assert_( isinstance(InputMethodKit.IMKCandidatesOpacityAttributeName, unicode) )

    def testProtocols(self):
        self.assert_( hasattr(InputMethodKit, 'protocols') )
        self.assert_( hasattr(InputMethodKit.protocols, 'IMKServerInput') )
        self.assert_( isinstance(InputMethodKit.protocols.IMKServerInput, objc.informal_protocol) )

    def testProtocols2(self):

if __name__ == "__main__":
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.