Commits

Ronald Oussoren committed cbfd1cd

Tests (Cocoa bindings) now pass on OSX 10.5, except for APIs that are no longer present in the 10.6 SDK

Comments (0)

Files changed (6)

pyobjc-framework-Cocoa/PyObjCTest/test_cfbundle.py

         url = CFBundleCopyResourceURLForLocalization(bundle, "Formatter", "strings", None, "Dutch");
         if url is None:
             url = CFBundleCopyResourceURLForLocalization(bundle, "Formatter", "strings", None, "nl");
+        if url is None:
+            url = CFBundleCopyResourceURLForLocalization(bundle, "Formatter", "strings", None, "en");
         self.assertIsInstance(url, CFURLRef)
 
         array = CFBundleCopyResourceURLsOfTypeForLocalization(bundle, "strings", None, "Dutch")

pyobjc-framework-Cocoa/PyObjCTest/test_cfdictionary.py

 
 class TestCFDictionary (TestCase):
 
-    def testTypes(self):
-        try:
-            NSCFDictionary = objc.lookUpClass('__NSCFDictionary')
-        except objc.error:
-            NSCFDictionary = objc.lookUpClass('NSCFDictionary')
-
-        self.assertIs(CFDictionaryRef, NSCFDictionary)
-
     def testCreation(self):
         dictionary = CFDictionaryCreate(None,
                 ('aap', 'noot', 'mies', 'wim'),

pyobjc-framework-Cocoa/PyObjCTest/test_nshfsfiletypes.py

 from PyObjCTools.TestSupport import *
+import os
 
 from Foundation import *
 
         self.assertIsInstance(w, unicode)
         self.assertEqual(w, u"'rtfd'")
            
-        v = NSHFSTypeOfFile('/Library/Documentation/Acknowledgements.rtf')
+        fname = '/Library/Documentation/Acknowledgements.rtf'
+        if not os.path.exists(fname):
+            fname = '/Library/Documentation/AirPort Acknowledgements.rtf'
+
+        if not os.path.exists(fname):
+            self.fail("test file doesn't exist")
+
+        v = NSHFSTypeOfFile(fname)
         self.assertIsInstance(v, unicode)
 
 if __name__ == "__main__":

pyobjc-framework-Cocoa/PyObjCTest/test_nsprocessinfo.py

         self.assertEqual(NSSunOSOperatingSystem, 6)
         self.assertEqual(NSOSF1OperatingSystem, 7)
 
+    @min_os_level('10.6')
     def testNSDisabledSuddenTermination(self):
         # annoyingly we cannot easily test if this has an effect, but
         # this at least guards against typos.

pyobjc-framework-Cocoa/PyObjCTest/test_nstextinputcontext.py

         self.assertArgIsBOOL(NSTextInputContext.setAcceptsGlyphInfo_, 0)
         self.assertResultIsBOOL(NSTextInputContext.handleEvent_)
 
-    @min_os_level('10.5')
+    @min_os_level('10.6')
     def testConstants(self):
         self.assertIsInstance(NSTextInputContextKeyboardSelectionDidChangeNotification, unicode)
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsurlrequest.py

 
     def testMethods(self):
         self.assertResultIsBOOL(NSURLRequest.HTTPShouldHandleCookies)
+        self.assertArgIsBOOL(NSMutableURLRequest.setHTTPShouldHandleCookies_, 0)
+
+    @min_os_level('10.7')
+    def testMethods10_7(self):
         self.assertResultIsBOOL(NSURLRequest.HTTPShouldUsePipelining)
-        self.assertArgIsBOOL(NSMutableURLRequest.setHTTPShouldHandleCookies_, 0)
         self.assertArgIsBOOL(NSMutableURLRequest.setHTTPShouldUsePipelining_, 0)
 
 if __name__ == "__main__":