[PyObjC-svn] r2578 - in trunk/pyobjc/pyobjc-framework-SearchKit: Lib/SearchKit PyObjCTest

[email protected] Sun, 15 Aug 2010 05:53:51 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Sun Aug 15 05:53:51 2010
New Revision: 2578

Log:
Some small tweaks to ensure that all tests pass


Modified:
   trunk/pyobjc/pyobjc-framework-SearchKit/Lib/SearchKit/__init__.py
   trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_searchkit.py
   trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_skindex.py

Modified: trunk/pyobjc/pyobjc-framework-SearchKit/Lib/SearchKit/__init__.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-SearchKit/Lib/SearchKit/__init__.py	(original)
+++ trunk/pyobjc/pyobjc-framework-SearchKit/Lib/SearchKit/__init__.py	Sun Aug 15 05:53:51 2010
@@ -82,7 +82,7 @@
         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(
@@ -90,6 +90,7 @@
         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
@@ -112,6 +113,4 @@
         SKDocumentRef, SKSearchRef,
     ) = workaround()
 
-    print "performed workaround"
-
     del workaround

Modified: trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_searchkit.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_searchkit.py	(original)
+++ trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_searchkit.py	Sun Aug 15 05:53:51 2010
@@ -2,18 +2,17 @@
 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') )
@@ -39,5 +38,5 @@
 
 
 if __name__ == "__main__":
-    unittest.main()
+    main()
 

Modified: trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_skindex.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_skindex.py	(original)
+++ trunk/pyobjc/pyobjc-framework-SearchKit/PyObjCTest/test_skindex.py	Sun Aug 15 05:53:51 2010
@@ -6,8 +6,8 @@
 
 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)

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev