Commits

Ronald Oussoren committed 922c9da

Various testsuite updates

Comments (0)

Files changed (11)

pyobjc-core/Lib/PyObjCTools/TestSupport.py

         if not isinstance(tp, objc.objc_class):
             self.fail(message or "%r is not a CFTypeRef type"%(tp,))
 
-        if tp is _nscftype:
+        if any(x is tp for x in _nscftype):
             self.fail(message or "%r is not a unique CFTypeRef type"%(tp,))
 
-        if not issubclass(tp, _nscftype):
-            self.fail(message or "%r is not a CFTypeRef subclass"%(tp,))
+        #if not issubclass(tp, _nscftype):
+        #    self.fail(message or "%r is not a CFTypeRef subclass"%(tp,))
 
 
     def assertIsOpaquePointer(self, tp, message = None):

pyobjc-core/Modules/objc/fsref.m

 	rc = FSRefMakePath( &((PyObjC_FSRefObject*)ref)->ref,
 			buffer, sizeof(buffer));
 	if (rc != 0) {
-#if PY_MAJOR_VERSION == 2
+#if (PY_MAJOR_VERSION == 2) && defined (USE_TOOLBOX_OBJECT_GLUE)
 		PyMac_Error(rc);
 #else
 		PyErr_Format(PyExc_OSError, "MAC Error %d", rc);
 	rc = FSPathMakeRef((UInt8*)PyBytes_AsString(value), &result, &isDirectory);
 	Py_DECREF(value);
 	if (rc != 0) {
-#if PY_MAJOR_VERSION == 2
+#if (PY_MAJOR_VERSION == 2) && defined(USE_TOOLBOX_OBJECT_GLUE)
 		PyMac_Error(rc);
 #else
 		PyErr_Format(PyExc_OSError, "MAC Error %d", rc);

pyobjc-core/NEWS.txt

    Version 2.5 is currently in development and hasn't been released
    yet.
 
+- Issue #37: Fix runtime link error with EPD (Enthought Python Distribution),
+  which doesn't include the pymactoolbox functionality.
 
 - A number of framework wrappers have a "protocols" submodule containing
   protocol objects (for example the module 'Foundation.protocol'). Use

pyobjc-framework-Cocoa/Modules/_AppKit.m

+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include "pyobjc-api.h"
 

pyobjc-framework-Cocoa/Modules/_CoreFoundation.m

+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include "pyobjc-api.h"
 

pyobjc-framework-Cocoa/Modules/_Foundation.m

+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include "pyobjc-api.h"
 

pyobjc-framework-Cocoa/PyObjCTest/test_cfpreferences.py

         self.assertResultIsCFRetained(CFPreferencesCopyApplicationList)
         apps = CFPreferencesCopyApplicationList(kCFPreferencesCurrentUser, kCFPreferencesAnyHost)
         self.assertIsInstance(apps, CFArrayRef)
-        self.assertIsIn(b"com.apple.AddressBook".decode('ascii'), apps)
+        self.assertIn(b"com.apple.AddressBook".decode('ascii'), apps)
         self.assertResultIsCFRetained(CFPreferencesCopyKeyList)
         keys = CFPreferencesCopyKeyList(b"com.apple.AddressBook".decode('ascii'), kCFPreferencesCurrentUser, kCFPreferencesAnyHost)
         self.assertIsInstance(keys, CFArrayRef)

pyobjc-framework-Cocoa/PyObjCTest/test_cfpropertylist.py

         v, err = CFPropertyListCreateFromXMLData(None, dta, 0, None)
         self.assertIs(err, None)
         self.assertIsInstance(v, CFDictionaryRef)
-        self.assertIsIn('key', v)
-        self.assertIsIn('key2', v)
+        self.assertIn('key', v)
+        self.assertIn('key2', v)
         self.assertEqual(v['key'] , 42)
         self.assertEqual(v['key2'] , True)
         v = CFPropertyListCreateDeepCopy(None, {b"key".decode('ascii'): 42, b"key2".decode('ascii'): True}, 0)
         self.assertIsInstance(v, CFDictionaryRef)
-        self.assertIsIn('key', v)
-        self.assertIsIn('key2', v)
+        self.assertIn('key', v)
+        self.assertIn('key2', v)
         self.assertEqual(v['key'] , 42)
         self.assertEqual(v['key2'] , True)
         valid = CFPropertyListIsValid({b"key".decode('ascii'): 42, b"key2".decode('ascii'): True}, kCFPropertyListBinaryFormat_v1_0)
         self.assertIsInstance(buf, CFDataRef)
         buf = CFDataGetBytes(buf, (0, CFDataGetLength(buf)), None)
         self.assertIsInstance(buf, bytes)
-        self.assertIsIn(b'<key>key1</key>', buf)
-        self.assertIsIn(b'<integer>42</integer>', buf)
-        self.assertIsIn(b'<key>key2</key>', buf)
-        self.assertIsIn(b'<integer>1</integer>', buf)
+        self.assertIn(b'<key>key1</key>', buf)
+        self.assertIn(b'<integer>42</integer>', buf)
+        self.assertIn(b'<key>key2</key>', buf)
+        self.assertIn(b'<integer>1</integer>', buf)
         stream = CFReadStreamCreateWithBytesNoCopy(None, buf, len(buf), kCFAllocatorNull)
         r = CFReadStreamOpen(stream)
         self.assertTrue(r)

pyobjc-framework-Cocoa/PyObjCTest/test_cftimezone.py

 
         r = CFTimeZoneIsDaylightSavingTime(zone,
                 CFGregorianDateGetAbsoluteTime(dt, zone))
-        self.assertIsIn(r, (False, True))
+        self.assertIn(r, (False, True))
         offset = CFTimeZoneGetDaylightSavingTimeOffset(zone,
                 CFGregorianDateGetAbsoluteTime(dt, zone))
         self.assertIsInstance(offset, float)

pyobjc-framework-LaunchServices/PyObjCTest/test_uttype.py

 
         self.assertResultIsBOOL(UTTypeEqual)
         v = UTTypeEqual("public.python-script", "public.python-script")
-        self.assertIsObject(v, True)
+        self.assertIs(v, True)
 
         self.assertResultIsBOOL(UTTypeConformsTo)
         v = UTTypeConformsTo("public.python-script", kUTTypePlainText)
-        self.assertIsObject(v, True)
+        self.assertIs(v, True)
 
         self.assertResultIsCFRetained(UTTypeCopyDescription)
         v = UTTypeCopyDescription(kUTTypePlainText)

pyobjc-framework-Quartz/PyObjCTest/test_cglayer.py

         self.assertIsInstance(sz, CGSize)
         self.assertEqual(sz, CGSize(50, 100))
 
-        self.failIfResultIsCFRetained(CGLayerGetContext)
+        self.assertResultIsNotCFRetained(CGLayerGetContext)
         ctx = CGLayerGetContext(layer)
         self.assertIsInstance(ctx, CGContextRef)
-        self.failIf(ctx is self.context)
+        self.assertIsNot(ctx, self.context)
 
         CGContextDrawLayerInRect(self.context, CGRectMake(0, 0, 50, 50), layer)
         CGContextDrawLayerAtPoint(self.context, CGPoint(10, 10), layer)
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 ProjectModifiedEvent.java.
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.