Commits

Ronald Oussoren  committed d917f06

Merged revisions 2578 via svnmerge from
https://svn.red-bean.com/pyobjc/trunk/pyobjc

........
r2578 | ronaldoussoren | 2010-08-15 12:53:51 +0200 (Sun, 15 Aug 2010) | 2 lines

Some small tweaks to ensure that all tests pass
........

  • Participants
  • Parent commits d5b7186
  • Branches pyobjc-2.3.x

Comments (0)

Files changed (3)

File pyobjc-framework-SearchKit/Lib/SearchKit/__init__.py

         indexType = objc.registerCFSignature(
                 "SKIndexRef", b"^{__SKIndex=}", indexID)
         iterType = objc.registerCFSignature(
-                "SKIndexDocumentIteratorRef", b"^{__SKIndexDocumentIterator=}", indexID)
+                "SKIndexDocumentIteratorRef", b"^{__SKIndexDocumentIterator=}", iterID)
         groupType = objc.registerCFSignature(
                 "SKSearchGroupRef", b"^{__SKSearchGroup=}", groupID)
         resultType = objc.registerCFSignature(
         summaryType = objc.registerCFSignature(
                 "SKSummaryRef", b"^{__SKSummary=}", summaryID)
 
+
         # For some reason SKDocumentGetTypeID doesn't return the right value
         # when the framework loader calls it the first time around,
         # by this time the framework is fully initialized and we get
         SKDocumentRef, SKSearchRef,
     ) = workaround()
 
-    print "performed workaround"
-
     del workaround

File pyobjc-framework-SearchKit/PyObjCTest/test_searchkit.py

 Some simple tests to check that the framework is properly wrapped.
 '''
 import objc
+from PyObjCTools.TestSupport import *
 import unittest
 import SearchKit
 
-class TestSearchKit (unittest.TestCase):
+class TestSearchKit (TestCase):
     def testClasses(self):
         self.assert_( hasattr(SearchKit, 'SKDocumentRef') )
-        self.assert_( issubclass(SearchKit.SKDocumentRef, objc.lookUpClass('NSCFType')) )
-        self.assert_( SearchKit.SKDocumentRef is not objc.lookUpClass('NSCFType') )
+        self.assertIsCFType( SearchKit.SKDocumentRef )
 
         self.assert_( hasattr(SearchKit, 'SKIndexRef') )
-        self.assert_( issubclass(SearchKit.SKIndexRef, objc.lookUpClass('NSCFType')) )
-        self.assert_( SearchKit.SKIndexRef is not objc.lookUpClass('NSCFType') )
+        self.assertIsCFType( SearchKit.SKIndexRef )
 
     def testValues(self):
         self.assert_( hasattr(SearchKit, 'kSKIndexInverted') )
 
 
 if __name__ == "__main__":
-    unittest.main()
+    main()
 

File pyobjc-framework-SearchKit/PyObjCTest/test_skindex.py

 
 class TestSKIndex (TestCase):
     def testTypes(self):
-        self.assertIsInstance(SKIndexRef, objc.objc_class)
-        self.assertIsInstance(SKIndexDocumentIteratorRef, objc.objc_class)
+        self.assertIsCFType(SKIndexRef)
+        self.assertIsCFType(SKIndexDocumentIteratorRef)
 
     def testConstants(self):
         self.assertEqual(kSKIndexUnknown, 0)