Commits

Ronald Oussoren committed 95fa2d0

Partial port to py3k. A number of test still fail, in particular
those that use CoreGraphics inline functions like CGRectMake.

  • Participants
  • Parent commits 4bbebed
  • Branches pyobjc-ancient

Comments (0)

Files changed (130)

File pyobjc-framework-Quartz/Modules/_CVPixelBuffer.m

 
 
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 	{
 		"CVPixelBufferCreateWithBytes",
 		(PyCFunction)mod_CVPixelBufferCreateWithBytes,
 
 #else /* ! WITH_CORE_VIDEO */
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 	{ 0, 0, 0, 0 }
 };
 
 
 
 
-void init_CVPixelBuffer(void);
-void init_CVPixelBuffer(void)
+PyObjC_MODULE_INIT(_CVPixelBuffer)
 {
-	PyObject* m = Py_InitModule4("_CVPixelBuffer", m_methods,
-				NULL, NULL, PYTHON_API_VERSION);
+	PyObject* m = PyObjC_MODULE_CREATE(_CVPixelBuffer);
+	if (!m) PyObjC_INITERROR();
 
-	if (PyObjC_ImportAPI(m) < 0) { return; }
+	if (PyObjC_ImportAPI(m) < 0) PyObjC_INITERROR();
+
+	PyObjC_INITDONE();
 }

File pyobjc-framework-Quartz/Modules/_CoreGraphics_inlines.m

 #include "Python.h"
+#include "pyobjc-api.h"
 #import <ApplicationServices/ApplicationServices.h>
 
 typedef void (*FUNCTION)(void);
         { 0, 0, 0, 0 } /* sentinel */
 };
 
-void init_inlines(void)
+PyObjC_MODULE_INIT(_inlines)
 {
-    PyObject* m = Py_InitModule4("_inlines", mod_methods, NULL, NULL, PYTHON_API_VERSION);
+    PyObject* m = PyObjC_MODULE_CREATE(_inlines);
+    if (!m) PyObjC_INITERROR();
 
-    PyModule_AddObject(m, "_inline_list_", 
-        PyCObject_FromVoidPtr(function_map, NULL));
+    if (PyModule_AddObject(m, "_inline_list_", 
+        PyObjC_CreateInlineTab(function_map)) < 0) PyObjC_INITERROR();
+
+    PyObjC_INITDONE();
 }

File pyobjc-framework-Quartz/Modules/_callbacks.m

 		size_t count)
 {
 	PyObject* info = (PyObject*)_info;
+	PyObject* buf;
 
 	PyGILState_STATE   state = PyGILState_Ensure();
 
-	PyObject* buf = PyBuffer_FromReadWriteMemory(buffer, count);
+#if 	PY_VERSION_HEX >= 0x02070000
+	Py_buffer view;
+	if (PyBuffer_FillInfo(&view, NULL, buffer, count, 1, PyBUF_WRITABLE) < 0) {
+		PyObjCErr_ToObjCWithGILState(&state);
+	}
+	buf = PyMemoryView_FromBuffer(&view);
+#else
+	buf = PyBuffer_FromReadWriteMemory(buffer, count);
+#endif
 	if (buf == NULL) {
 		PyObjCErr_ToObjCWithGILState(&state);
 	}
 		size_t offset, size_t count)
 {
 	PyObject* info = (PyObject*)_info;
+	PyObject* buf;
 
 	PyGILState_STATE   state = PyGILState_Ensure();
 
-	PyObject* buf = PyBuffer_FromReadWriteMemory(buffer, count);
+#if 	PY_VERSION_HEX >= 0x02070000
+	Py_buffer view;
+	if (PyBuffer_FillInfo(&view, NULL, buffer, count, 1, PyBUF_WRITABLE) < 0) {
+		PyObjCErr_ToObjCWithGILState(&state);
+	}
+	buf = PyMemoryView_FromBuffer(&view);
+#else
+	buf = PyBuffer_FromReadWriteMemory(buffer, count);
+#endif
 	if (buf == NULL) {
 		PyObjCErr_ToObjCWithGILState(&state);
 	}
 
 	PyGILState_STATE   state = PyGILState_Ensure();
 
+#if PY_VERSION_MAJOR == 2
 	tag = PyInt_AsLong(PyTuple_GET_ITEM(info, 2));
+#else
+	tag = PyLong_AsLong(PyTuple_GET_ITEM(info, 2));
+#endif
 
 	if (PyTuple_GET_ITEM(info, 1) != Py_None) {
 		PyObject* result = PyObject_CallFunction(
 
 	PyGILState_STATE   state = PyGILState_Ensure();
 
+#if PY_VERSION_MAJOR == 2
 	domdim = PyInt_AsLong(PyTuple_GET_ITEM(info, 2));
 	rangedim = PyInt_AsLong(PyTuple_GET_ITEM(info, 3));
+#else
+	domdim = PyLong_AsLong(PyTuple_GET_ITEM(info, 2));
+	rangedim = PyLong_AsLong(PyTuple_GET_ITEM(info, 3));
+#endif
 
 	PyObject* input;
 	if (inData) {
 }
 
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 	{
 		"CGDataConsumerCreate",
 		(PyCFunction)m_CGDataConsumerCreate,
 	{ 0, 0, 0, }
 };
 
-void init_callbacks(void);
-void init_callbacks(void)
+PyObjC_MODULE_INIT(_callbacks)
 {
-	PyObject* m = Py_InitModule4("_callbacks", m_methods,
-		NULL, NULL, PYTHON_API_VERSION);
+	PyObject* m = PyObjC_MODULE_CREATE(_callbacks);
+	if (!m) PyObjC_INITERROR();
+
 	PyObject* md = PyModule_GetDict(m);
+	if (!md) PyObjC_INITERROR();
 
-        if (PyObjC_ImportAPI(m) < 0) { return; }
+        if (PyObjC_ImportAPI(m) < 0) PyObjC_INITERROR();
 
 #if PyObjC_BUILD_RELEASE >= 1005
 	if (CGDataProviderCreateSequential == NULL) {
-		PyDict_DelItemString(md, "CGDataProviderCreateSequential");
+		if (PyDict_DelItemString(md, "CGDataProviderCreateSequential") < 0) {
+			PyObjC_INITERROR();
+		}
 	}
 #endif
 	
-
+	PyObjC_INITDONE();
 }

File pyobjc-framework-Quartz/Modules/_coregraphics.m

 }
 
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 #if PyObjC_BUILD_RELEASE >= 1005
 	{
 		"CGFontCopyTableTags",
 	{ 0, 0, 0, }
 };
 
-void init_coregraphics(void);
-void init_coregraphics(void)
+PyObjC_MODULE_INIT(_coregraphics)
 {
-	PyObject* m = Py_InitModule4("_coregraphics", m_methods,
-		NULL, NULL, PYTHON_API_VERSION);
+	PyObject* m = PyObjC_MODULE_CREATE(_coregraphics);
+	if (!m) PyObjC_INITERROR();
+
 #if PyObjC_BUILD_RELEASE >= 1005
 	PyObject* d = PyModule_GetDict(m);
+	if (!d) PyObjC_INITERROR();
 #endif
 
-        if (PyObjC_ImportAPI(m) < 0) { return; }
+        if (PyObjC_ImportAPI(m) < 0) PyObjC_INITERROR();
 
 #if PyObjC_BUILD_RELEASE >= 1005
 	if (CGFontCopyTableTags == NULL) {
-		PyDict_DelItemString(d, "CGFontCopyTableTags");
+		if (PyDict_DelItemString(d, "CGFontCopyTableTags") < 0) {
+			PyObjC_INITERROR();
+		}
 	}
 
 	if (CGWindowListCreate == NULL) {
-		PyDict_DelItemString(d, "CGWindowListCreate");
+		if (PyDict_DelItemString(d, "CGWindowListCreate") < 0) {
+			PyObjC_INITERROR();
+		}
 	}
 
 	if (CGWindowListCreateDescriptionFromArray == NULL) {
-		PyDict_DelItemString(d, "CGWindowListCreateDescriptionFromArray");
+		if (PyDict_DelItemString(d, "CGWindowListCreateDescriptionFromArray") < 0) {
+			PyObjC_INITERROR();
+		}
 	}
 
 	if (CGWindowListCreateImageFromArray == NULL) {
-		PyDict_DelItemString(d, "CGWindowListCreateImageFromArray");
+		if (PyDict_DelItemString(d, "CGWindowListCreateImageFromArray") < 0) {
+			PyObjC_INITERROR();
+		}
 	}
 #endif 
+
+	PyObjC_INITDONE();
 }

File pyobjc-framework-Quartz/Modules/_doubleindirect.m

 }
 
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 	{
 		"CGWaitForScreenRefreshRects",
 		(PyCFunction)m_CGWaitForScreenRefreshRects,
 	{ 0, 0, 0, 0 }
 };
 
-void init_doubleindirect(void);
-void init_doubleindirect(void)
+PyObjC_MODULE_INIT(_doubleindirect)
 {
-	PyObject* m = Py_InitModule4("_doubleindirect", m_methods,
-				NULL, NULL, PYTHON_API_VERSION);
+	PyObject* m = PyObjC_MODULE_CREATE(_doubleindirect);
 
-	if (PyObjC_ImportAPI(m) < 0) { return; }
+	if (PyObjC_ImportAPI(m) < 0) PyObjC_INITERROR();
 
+	PyObjC_INITDONE();
 }

File pyobjc-framework-Quartz/Modules/_sortandmap.m

 		PyObjCErr_ToObjCWithGILState(&state);
 	}
 
-	PyTuple_SET_ITEM(args, 0, PyString_FromString(key));
+	PyTuple_SET_ITEM(args, 0, PyBytes_FromString(key));
 	if (PyTuple_GET_ITEM(args, 0) == NULL) {
 		Py_DECREF(args);
 		PyObjCErr_ToObjCWithGILState(&state);
 	return Py_None;
 }
 
-static PyMethodDef m_methods[] = {
+static PyMethodDef mod_methods[] = {
 	{
 		"CGPDFDictionaryApplyFunction",
 		(PyCFunction)m_CGPDFDictionaryApplyFunction,
 };
 
 
-void init_sortandmap(void);
-void init_sortandmap(void)
+PyObjC_MODULE_INIT(_sortandmap)
 {
-	PyObject* m = Py_InitModule4("_sortandmap", m_methods,
-		NULL, NULL, PYTHON_API_VERSION);
+	PyObject* m = PyObjC_MODULE_CREATE(_sortandmap);
 
-	if (PyObjC_ImportAPI(m) < 0) { return; }
+	if (PyObjC_ImportAPI(m) < 0) PyObjC_INITERROR();
+
+	PyObjC_INITDONE();
 }
-

File pyobjc-framework-Quartz/Modules/pyobjc-api.h

-#ifndef PyObjC_API_H
-#define PyObjC_API_H
-
-/*
- * Use this in helper modules for the objc package, and in wrappers
- * for functions that deal with objective-C objects/classes
- * 
- * This header defines some utility wrappers for importing and using 
- * the core bridge. 
- *
- * This is the *only* header file that should be used to access 
- * functionality in the core bridge.
- *
- * WARNING: this file is not part of the public interface of PyObjC and
- * might change or be removed without warning or regard for backward
- * compatibility.
- */
-
-#include "Python.h"
-#include <objc/objc.h>
-
-#import <Foundation/Foundation.h>
-
-#ifndef CGFLOAT_DEFINED
-
-#ifdef __LP64__
-# error "Huh? 64-bit but no CFFloat available???"
-#endif
-
-typedef float CGFloat;
-#define CGFLOAT_MIN FLT_MIN
-#define CGFLOAT_MAX FLT_MAX
-#define CGFLOAT_IS_DOUBLE 0
-#define CGFLOAT_DEFINED
-
-#endif /* CGFLOAT_DEFINED */
-
-
-#ifndef NSINTEGER_DEFINED
-
-#ifdef __LP64__
-# error "Huh? 64-bit but no NSINTEGER available???"
-#endif
-
-typedef int NSInteger;
-typedef unsigned int NSUInteger;
-
-#define NSIntegerMax    LONG_MAX
-#define NSIntegerMin    LONG_MIN
-#define NSUIntegerMax   ULONG_MAX
-
-#define NSINTEGER_DEFINED
-
-#endif
-
-
-#ifndef PyObjC_COMPAT_H
-#if (PY_VERSION_HEX < 0x02050000)
-typedef int Py_ssize_t;
-#define PY_FORMAT_SIZE_T ""
-#define Py_ARG_SIZE_T "n"
-#define PY_SSIZE_T_MAX INT_MAX
-
-#else
-
-#define Py_ARG_SIZE_T "i"
-#endif
-#endif
-
-#import <Foundation/NSException.h>
-
-struct PyObjC_WeakLink {
-	const char* name;
-	void (*func)(void);
-};
-
-
-/* threading support */
-#ifdef NO_OBJC2_RUNTIME
-#define PyObjC_DURING \
-		Py_BEGIN_ALLOW_THREADS \
-		NS_DURING
-
-#define PyObjC_HANDLER NS_HANDLER
-
-#define PyObjC_ENDHANDLER \
-		NS_ENDHANDLER \
-		Py_END_ALLOW_THREADS
-#else
-
-#define	PyObjC_DURING \
-		Py_BEGIN_ALLOW_THREADS \
-		@try {
-
-#define PyObjC_HANDLER } @catch(volatile NSObject* _localException) { \
-		NSException* localException __attribute__((__unused__))= (NSException*)_localException;
-
-#define PyObjC_ENDHANDLER \
-		} \
-		Py_END_ALLOW_THREADS
-
-#endif
-
-#define PyObjC_BEGIN_WITH_GIL \
-	{ \
-		PyGILState_STATE _GILState; \
-		_GILState = PyGILState_Ensure(); 
-
-#define PyObjC_GIL_FORWARD_EXC() \
-		do { \
-            PyObjCErr_ToObjCWithGILState(&_GILState); \
-		} while (0)
-
-
-#define PyObjC_GIL_RETURN(val) \
-		do { \
-			PyGILState_Release(_GILState); \
-			return (val); \
-		} while (0)
-
-#define PyObjC_GIL_RETURNVOID \
-		do { \
-			PyGILState_Release(_GILState); \
-			return; \
-		} while (0)
-
-
-#define PyObjC_END_WITH_GIL \
-		PyGILState_Release(_GILState); \
-	}
-
-
-
-#include <objc/objc-runtime.h>
-
-/* On 10.1 there are no defines for the OS version. */
-#ifndef MAC_OS_X_VERSION_10_1
-#define MAC_OS_X_VERSION_10_1 1010
-#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_1
-
-#error "MAC_OS_X_VERSION_10_1 not defined. You aren't running 10.1 are you?"
-
-#endif
-
-#ifndef MAC_OS_X_VERSION_10_2
-#define MAC_OS_X_VERSION_10_2 1020
-#endif
-
-#ifndef MAC_OS_X_VERSION_10_3
-#define MAC_OS_X_VERSION_10_3 1030
-#endif
-
-#ifndef MAC_OS_X_VERSION_10_4
-#define MAC_OS_X_VERSION_10_4 1040
-#endif
-
-#ifndef MAC_OS_X_VERSION_10_5
-#define MAC_OS_X_VERSION_10_5 1050
-#endif
-
-/* Current API version, increase whenever:
- * - Semantics of current functions change
- * - Functions are removed
- * Do not increase when adding a new function, the struct_len field
- * can be used for detecting if a function has been added.
- *
- * HISTORY:
- * - Version 2.2 adds PyObjCUnsupportedMethod_IMP 
- *       and PyObjCUnsupportedMethod_Caller 
- * - Version 2.1 adds PyObjCPointerWrapper_Register 
- * - Version 2 adds an argument to PyObjC_InitSuper
- * - Version 3 adds another argument to PyObjC_CallPython
- * - Version 4 adds PyObjCErr_ToObjCGILState
- * - Version 4.1 adds PyObjCRT_AlignOfType and PyObjCRT_SizeOfType
- *         (PyObjC_SizeOfType is now deprecated)
- * - Version 4.2 adds PyObjCRT_SELName
- * - Version 4.3 adds PyObjCRT_SimplifySignature
- * - Version 4.4 adds PyObjC_FreeCArray, PyObjC_PythonToCArray and
- *   		PyObjC_CArrayToPython
- * - Version 5 modifies the signature for PyObjC_RegisterMethodMapping,
- *	PyObjC_RegisterSignatureMapping and PyObjCUnsupportedMethod_IMP,
- *      adds PyObjC_RegisterStructType and removes PyObjC_CallPython
- * - Version 6 adds PyObjCIMP_Type, PyObjCIMP_GetIMP and PyObjCIMP_GetSelector
- * - Version 7 adds PyObjCErr_AsExc, PyGILState_Ensure
- * - Version 8 adds PyObjCObject_IsUninitialized,
-        removes PyObjCSelector_IsInitializer
- * - Version 9 (???)
- * - Version 10 changes the signature of PyObjCRT_SimplifySignature
- * - Version 11 adds PyObjCObject_Convert, PyObjCSelector_Convert,
-     PyObjCClass_Convert, PyObjC_ConvertBOOL, and PyObjC_ConvertChar
- * - Version 12 adds PyObjCObject_New
- * - Version 13 adds PyObjCCreateOpaquePointerType
- * - Version 14 adds PyObjCObject_NewTransient, PyObjCObject_ReleaseTransient
- * - Version 15 changes the interface of PyObjCObject_New
- * - Version 16 adds PyObjC_PerformWeaklinking
- * - Version 17 introduces Py_ssize_t support
- * - Version 18 introduces several API incompatibilities
- */
-#define PYOBJC_API_VERSION 18
-
-#define PYOBJC_API_NAME "__C_API__"
-
-/* 
- * Only add items to the end of this list!
- */
-typedef int (RegisterMethodMappingFunctionType)(
-			Class, 
-			SEL, 
-			PyObject *(*)(PyObject*, PyObject*, PyObject*),
-			void (*)(void*, void*, void**, void*));
-
-struct pyobjc_api {
-	int	      api_version;	/* API version */
-	size_t	      struct_len;	/* Length of this struct */
-	PyTypeObject* class_type;	/* PyObjCClass_Type    */
-	PyTypeObject* object_type;	/* PyObjCObject_Type   */
-	PyTypeObject* select_type;	/* PyObjCSelector_Type */
-
-	/* PyObjC_RegisterMethodMapping */
-	RegisterMethodMappingFunctionType *register_method_mapping;
-
-	/* PyObjC_RegisterSignatureMapping */
-	int (*register_signature_mapping)(
-			char*,
-			PyObject *(*)(PyObject*, PyObject*, PyObject*),
-			void (*)(void*, void*, void**, void*));
-
-	/* PyObjCObject_GetObject */
-	id (*obj_get_object)(PyObject*);
-
-	/* PyObjCObject_ClearObject */
-	void (*obj_clear_object)(PyObject*);
-
-	/* PyObjCClass_GetClass */
-	Class (*cls_get_class)(PyObject*);
-
-	/* PyObjCClass_New */
-	PyObject* (*cls_to_python)(Class cls);
-
-	/* PyObjC_PythonToId */
-	id (*python_to_id)(PyObject*);
-
-	/* PyObjC_IdToPython */
-	PyObject* (*id_to_python)(id);
-
-	/* PyObjCErr_FromObjC */
-	void (*err_objc_to_python)(NSException*);
-
-	/* PyObjCErr_ToObjC */
-	void (*err_python_to_objc)(void);
-
-	/* PyObjC_PythonToObjC */
-	int (*py_to_objc)(const char*, PyObject*, void*);
-
-	/* PyObjC_ObjCToPython */
-	PyObject* (*objc_to_py)(const char*, void*);
-
-	/* PyObjC_SizeOfType */
-	Py_ssize_t   (*sizeof_type)(const char*);
-
-	/* PyObjCSelector_GetClass */
-	Class	   (*sel_get_class)(PyObject* sel);
-
-	/* PyObjCSelector_GetSelector */
-	SEL	   (*sel_get_sel)(PyObject* sel);
-
-	/* PyObjC_InitSuper */ 	
-	void	(*fill_super)(struct objc_super*, Class, id);
-
-	/* PyObjC_InitSuperCls */
-	void	(*fill_super_cls)(struct objc_super*, Class, Class);
-
-	/* PyObjCPointerWrapper_Register */ 
-	int  (*register_pointer_wrapper)(
-		        const char*, PyObject* (*pythonify)(void*),
-			int (*depythonify)(PyObject*, void*)
-		);
-
-	void (*unsupported_method_imp)(void*, void*, void**, void*);
-	PyObject* (*unsupported_method_caller)(PyObject*, PyObject*, PyObject*);
-
-	/* PyObjCErr_ToObjCWithGILState */
-	void (*err_python_to_objc_gil)(PyGILState_STATE* state);
-
-	/* PyObjCRT_AlignOfType */
-	Py_ssize_t (*alignof_type)(const char* typestr);
-
-	/* PyObjCRT_SELName */
-	const char* (*selname)(SEL sel);
-
-	/* PyObjCRT_SimplifySignature */
-	int (*simplify_sig)(char* signature, char* buf, size_t buflen);
-
-	/* PyObjC_FreeCArray */
-	void    (*free_c_array)(int,void*);
-
-	/* PyObjC_PythonToCArray */
-	int     (*py_to_c_array)(BOOL, BOOL, const char*, PyObject*, void**, Py_ssize_t*, PyObject**);
-	
-	/* PyObjC_CArrayToPython */
-	PyObject* (*c_array_to_py)(const char*, void*, Py_ssize_t);
-
-	/* PyObjC_RegisterStructType */
-	PyObject* (*register_struct)(const char*, const char*, const char*, initproc, Py_ssize_t, const char**);
-
-	/* PyObjCIMP_Type */
-	PyTypeObject* imp_type;
-
-	/* PyObjCIMP_GetIMP */
-	IMP  (*imp_get_imp)(PyObject*);
-
-	/* PyObjCIMP_GetSelector */
-	SEL  (*imp_get_sel)(PyObject*);
-
-	/* PyObjCErr_AsExc */
-	NSException* (*err_python_to_nsexception)(void);
-
-	/* PyGILState_Ensure */
-	PyGILState_STATE (*gilstate_ensure)(void);
-
-	/* PyObjCObject_IsUninitialized */
-	int (*obj_is_uninitialized)(PyObject*);
-
-	/* PyObjCObject_Convert */
-	int (*pyobjcobject_convert)(PyObject*,void*);
-
-	/* PyObjCSelector_Convert */
-	int (*pyobjcselector_convert)(PyObject*,void*);
-
-	/* PyObjCClass_Convert */
-	int (*pyobjcclass_convert)(PyObject*,void*);
-
-	/* PyObjC_ConvertBOOL */
-	int (*pyobjc_convertbool)(PyObject*,void*);
-
-	/* PyObjC_ConvertChar */
-	int (*pyobjc_convertchar)(PyObject*,void*);
-
-	/* PyObjCObject_New */
-	PyObject* (*pyobjc_object_new)(id, int , int);
-
-	/* PyObjCCreateOpaquePointerType */
-	PyObject* (*pointer_type_new)(const char*, const char*, const char*);
-
-	/* PyObject* PyObjCObject_NewTransient(id objc_object, int* cookie); */
-	PyObject* (*newtransient)(id objc_object, int* cookie);
-
-	/* void PyObjCObject_ReleaseTransient(PyObject* proxy, int cookie); */
-	void (*releasetransient)(PyObject* proxy, int cookie);
-
-	void (*doweaklink)(PyObject*, struct PyObjC_WeakLink*);
-
-	const char* (*removefields)(char*, const char*);
-
-	PyObject** pyobjc_null;
-
-	int (*dep_c_array_count)(const char* type, Py_ssize_t count, BOOL strict, PyObject* value, void* datum);
-
-	PyObject* (*varlistnew)(const char* tp, void* array);
-};
-
-#ifndef PYOBJC_BUILD
-
-#ifndef PYOBJC_METHOD_STUB_IMPL
-static struct pyobjc_api*	PyObjC_API;
-#endif /* PYOBJC_METHOD_STUB_IMPL */
-
-#define PyObjCObject_Check(obj) PyObject_TypeCheck(obj, PyObjC_API->object_type)
-#define PyObjCClass_Check(obj)  PyObject_TypeCheck(obj, PyObjC_API->class_type)
-#define PyObjCSelector_Check(obj)  PyObject_TypeCheck(obj, PyObjC_API->select_type)
-#define PyObjCIMP_Check(obj)  PyObject_TypeCheck(obj, PyObjC_API->imp_type)
-#define PyObjCObject_GetObject (PyObjC_API->obj_get_object)
-#define PyObjCObject_ClearObject (PyObjC_API->obj_clear_object)
-#define PyObjCClass_GetClass   (PyObjC_API->cls_get_class)
-#define PyObjCClass_New 	     (PyObjC_API->cls_to_python)
-#define PyObjCSelector_GetClass (PyObjC_API->sel_get_class)
-#define PyObjCSelector_GetSelector (PyObjC_API->sel_get_sel)
-#define PyObjC_PythonToId      (PyObjC_API->python_to_id)
-#define PyObjC_IdToPython      (PyObjC_API->id_to_python)
-#define PyObjCErr_FromObjC     (PyObjC_API->err_objc_to_python)
-#define PyObjCErr_ToObjC       (PyObjC_API->err_python_to_objc)
-#define PyObjCErr_ToObjCWithGILState       (PyObjC_API->err_python_to_objc_gil)
-#define PyObjCErr_AsExc        (PyObjC_API->err_python_to_nsexception)
-#define PyObjC_PythonToObjC    (PyObjC_API->py_to_objc)
-#define PyObjC_ObjCToPython    (PyObjC_API->objc_to_py)
-#define PyObjC_RegisterMethodMapping (PyObjC_API->register_method_mapping)
-#define PyObjC_RegisterSignatureMapping (PyObjC_API->register_signature_mapping)
-#define PyObjC_SizeOfType      (PyObjC_API->sizeof_type)
-#define PyObjC_PythonToObjC   (PyObjC_API->py_to_objc)
-#define PyObjC_ObjCToPython   (PyObjC_API->objc_to_py)
-#define PyObjC_InitSuper	(PyObjC_API->fill_super)
-#define PyObjC_InitSuperCls	(PyObjC_API->fill_super_cls)
-#define PyObjCPointerWrapper_Register (PyObjC_API->register_pointer_wrapper)
-#define PyObjCUnsupportedMethod_IMP (PyObjC_API->unsupported_method_imp)
-#define PyObjCUnsupportedMethod_Caller (PyObjC_API->unsupported_method_caller)
-#define PyObjCRT_SizeOfType      (PyObjC_API->sizeof_type)
-#define PyObjCRT_AlignOfType	(PyObjC_API->alignof_type)
-#define PyObjCRT_SELName	(PyObjC_API->selname)
-#define PyObjCRT_SimplifySignature	(PyObjC_API->simplify_sig)
-#define PyObjC_FreeCArray	(PyObjC_API->free_c_array)
-#define PyObjC_PythonToCArray	(PyObjC_API->py_to_c_array)
-#define PyObjC_CArrayToPython	(PyObjC_API->c_array_to_py)
-#define PyObjC_RegisterStructType   (PyObjC_API->register_struct)
-#define PyObjCIMP_GetIMP   (PyObjC_API->imp_get_imp)
-#define PyObjCIMP_GetSelector   (PyObjC_API->imp_get_sel)
-#define PyObjCObject_IsUninitialized (PyObjC_API->obj_is_uninitialized)
-#define PyObjCObject_Convert (PyObjC_API->pyobjcobject_convert)
-#define PyObjCSelector_Convert (PyObjC_API->pyobjcselector_convert)
-#define PyObjCClass_Convert (PyObjC_API->pyobjcselector_convert)
-#define PyObjC_ConvertBOOL (PyObjC_API->pyobjc_convertbool)
-#define PyObjC_ConvertChar (PyObjC_API->pyobjc_convertchar)
-#define PyObjCObject_New (PyObjC_API->pyobjc_object_new)
-#define PyObjCCreateOpaquePointerType (PyObjC_API->pointer_type_new)
-#define PyObjCObject_NewTransient (PyObjC_API->newtransient)
-#define PyObjCObject_ReleaseTransient (PyObjC_API->releasetransient)
-#define PyObjC_PerformWeaklinking (PyObjC_API->doweaklink)
-#define PyObjCRT_RemoveFieldNames (PyObjC_API->removefields)
-#define PyObjC_NULL		  (*(PyObjC_API->pyobjc_null))
-#define PyObjC_DepythonifyCArray  (PyObjC_API->dep_c_array_count)
-#define PyObjC_VarList_New  (PyObjC_API->varlistnew)
-
-
-#ifndef PYOBJC_METHOD_STUB_IMPL
-
-static int
-PyObjC_ImportAPI(PyObject* calling_module)
-{
-	PyObject* m;
-	PyObject* d;
-	PyObject* api_obj;
-	PyObject* name = PyString_FromString("objc");
-	
-	m = PyImport_Import(name);
-	Py_DECREF(name);
-	if (m == NULL) {
-		return -1;
-	}
-
-	d = PyModule_GetDict(m);
-	if (d == NULL) {
-		PyErr_SetString(PyExc_RuntimeError, 
-			"No dict in objc module");
-		return -1;
-	}
-
-	api_obj = PyDict_GetItemString(d, PYOBJC_API_NAME);
-	if (api_obj == NULL) {
-		PyErr_SetString(PyExc_RuntimeError, 
-			"No C_API in objc module");
-		return -1;
-	}
-	PyObjC_API = PyCObject_AsVoidPtr(api_obj);
-	if (PyObjC_API == NULL) {
-		return 0;
-	}
-	if (PyObjC_API->api_version != PYOBJC_API_VERSION) {
-		PyErr_SetString(PyExc_RuntimeError,
-			"Wrong version of PyObjC C API");
-		return -1;
-	}
-	
-	if (PyObjC_API->struct_len < sizeof(struct pyobjc_api)) {
-		PyErr_SetString(PyExc_RuntimeError,
-			"Wrong struct-size of PyObjC C API");
-		return -1;
-	}
-
-	Py_INCREF(api_obj);
-
-	/* Current pyobjc implementation doesn't allow deregistering 
-	 * information, avoid unloading of users of the C-API.
-	 * (Yes this is ugle, patches to fix this situation are apriciated)
-	 */
-	Py_INCREF(calling_module);
-
-	return 0;
-}
-#endif /* PYOBJC_METHOD_STUB_IMPL */
-
-#else /* PyObjC_BUILD */
-
-extern struct pyobjc_api	objc_api;
-
-#endif /* !PYOBJC_BUILD */
-
-#endif /*  PyObjC_API_H */

File pyobjc-framework-Quartz/PyObjCTest/test_IKFilterBrowserPanel.py

 class TestIKFilterBrowserPanel (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessArgIsSEL(IKFilterBrowserPanel.beginWithOptions_modelessDelegate_didEndSelector_contextInfo_, 2, "v@:@i^v")
-        self.failUnlessArgIsSEL(IKFilterBrowserPanel.beginSheetWithOptions_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 3, "v@:@i^v")
+        self.assertArgIsSEL(IKFilterBrowserPanel.beginWithOptions_modelessDelegate_didEndSelector_contextInfo_, 2, b"v@:@i^v")
+        self.assertArgIsSEL(IKFilterBrowserPanel.beginSheetWithOptions_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 3, b"v@:@i^v")
 
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(IKFilterBrowserFilterSelectedNotification, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserFilterDoubleClickNotification, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserWillPreviewFilterNotification, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserShowCategories, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserShowPreview, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserExcludeCategories, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserExcludeFilters, unicode)
-        self.failUnlessIsInstance(IKFilterBrowserDefaultInputImage, unicode)
+        self.assertIsInstance(IKFilterBrowserFilterSelectedNotification, unicode)
+        self.assertIsInstance(IKFilterBrowserFilterDoubleClickNotification, unicode)
+        self.assertIsInstance(IKFilterBrowserWillPreviewFilterNotification, unicode)
+        self.assertIsInstance(IKFilterBrowserShowCategories, unicode)
+        self.assertIsInstance(IKFilterBrowserShowPreview, unicode)
+        self.assertIsInstance(IKFilterBrowserExcludeCategories, unicode)
+        self.assertIsInstance(IKFilterBrowserExcludeFilters, unicode)
+        self.assertIsInstance(IKFilterBrowserDefaultInputImage, unicode)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_IKFilterBrowserView.py

 class TestIKFilterBrowserView (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessArgIsBOOL(IKFilterBrowserView.setPreviewState_, 0)
+        self.assertArgIsBOOL(IKFilterBrowserView.setPreviewState_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_IKImageView.py

 class TestIKImageView (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(IKToolModeNone, unicode)
-        self.failUnlessIsInstance(IKToolModeMove, unicode)
-        self.failUnlessIsInstance(IKToolModeSelect, unicode)
-        self.failUnlessIsInstance(IKToolModeCrop, unicode)
-        self.failUnlessIsInstance(IKToolModeRotate, unicode)
-        self.failUnlessIsInstance(IKToolModeAnnotate, unicode)
-        self.failUnlessIsInstance(IKOverlayTypeBackground, unicode)
-        self.failUnlessIsInstance(IKOverlayTypeImage, unicode)
+        self.assertIsInstance(IKToolModeNone, unicode)
+        self.assertIsInstance(IKToolModeMove, unicode)
+        self.assertIsInstance(IKToolModeSelect, unicode)
+        self.assertIsInstance(IKToolModeCrop, unicode)
+        self.assertIsInstance(IKToolModeRotate, unicode)
+        self.assertIsInstance(IKToolModeAnnotate, unicode)
+        self.assertIsInstance(IKOverlayTypeBackground, unicode)
+        self.assertIsInstance(IKOverlayTypeImage, unicode)
 
     @min_os_level('10.5')
     def testConstants10_5(self):
-        self.failUnlessIsInstance(IKToolModeSelectRect, unicode)
-        self.failUnlessIsInstance(IKToolModeSelectEllipse, unicode)
-        self.failUnlessIsInstance(IKToolModeSelectLasso, unicode)
+        self.assertIsInstance(IKToolModeSelectRect, unicode)
+        self.assertIsInstance(IKToolModeSelectEllipse, unicode)
+        self.assertIsInstance(IKToolModeSelectLasso, unicode)
 
 
 

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotation.py

 
 class TestPDFAnnotation (TestCase):
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFAnnotation.shouldDisplay)
-        self.failUnlessArgIsBOOL(PDFAnnotation.setShouldDisplay_, 0)
-        self.failUnlessResultIsBOOL(PDFAnnotation.shouldPrint)
-        self.failUnlessArgIsBOOL(PDFAnnotation.setShouldPrint_, 0)
-        self.failUnlessResultIsBOOL(PDFAnnotation.hasAppearanceStream)
+        self.assertResultIsBOOL(PDFAnnotation.shouldDisplay)
+        self.assertArgIsBOOL(PDFAnnotation.setShouldDisplay_, 0)
+        self.assertResultIsBOOL(PDFAnnotation.shouldPrint)
+        self.assertArgIsBOOL(PDFAnnotation.setShouldPrint_, 0)
+        self.assertResultIsBOOL(PDFAnnotation.hasAppearanceStream)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationButtonWidget.py

 
 class TestPDFAnnotationButtonWidget (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kPDFWidgetUnknownControl, -1)
-        self.failUnlessEqual(kPDFWidgetPushButtonControl, 0) 
-        self.failUnlessEqual(kPDFWidgetRadioButtonControl, 1)
-        self.failUnlessEqual(kPDFWidgetCheckBoxControl, 2)
+        self.assertEqual(kPDFWidgetUnknownControl, -1)
+        self.assertEqual(kPDFWidgetPushButtonControl, 0) 
+        self.assertEqual(kPDFWidgetRadioButtonControl, 1)
+        self.assertEqual(kPDFWidgetCheckBoxControl, 2)
 
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFAnnotationButtonWidget.isHighlighted)
-        self.failUnlessResultIsBOOL(PDFAnnotationButtonWidget.allowsToggleToOff)
+        self.assertResultIsBOOL(PDFAnnotationButtonWidget.isHighlighted)
+        self.assertResultIsBOOL(PDFAnnotationButtonWidget.allowsToggleToOff)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationChoiceWidget.py

 
 class TestPDFAnnotationChoiceWidget (TestCase):
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFAnnotationChoiceWidget.isListChoice)
-        self.failUnlessArgIsBOOL(PDFAnnotationChoiceWidget.setIsListChoice_, 0)
+        self.assertResultIsBOOL(PDFAnnotationChoiceWidget.isListChoice)
+        self.assertArgIsBOOL(PDFAnnotationChoiceWidget.setIsListChoice_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationLine.py

 
 class TestPDFAnnotationLine (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kPDFLineStyleNone, 0)
-        self.failUnlessEqual(kPDFLineStyleSquare, 1)
-        self.failUnlessEqual(kPDFLineStyleCircle, 2)
-        self.failUnlessEqual(kPDFLineStyleDiamond, 3)
-        self.failUnlessEqual(kPDFLineStyleOpenArrow, 4)
-        self.failUnlessEqual(kPDFLineStyleClosedArrow, 5)
+        self.assertEqual(kPDFLineStyleNone, 0)
+        self.assertEqual(kPDFLineStyleSquare, 1)
+        self.assertEqual(kPDFLineStyleCircle, 2)
+        self.assertEqual(kPDFLineStyleDiamond, 3)
+        self.assertEqual(kPDFLineStyleOpenArrow, 4)
+        self.assertEqual(kPDFLineStyleClosedArrow, 5)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationMarkup.py

 
 class TestPDFAnnotationMarkup (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kPDFMarkupTypeHighlight, 0)
-        self.failUnlessEqual(kPDFMarkupTypeStrikeOut, 1)
-        self.failUnlessEqual(kPDFMarkupTypeUnderline, 2)
+        self.assertEqual(kPDFMarkupTypeHighlight, 0)
+        self.assertEqual(kPDFMarkupTypeStrikeOut, 1)
+        self.assertEqual(kPDFMarkupTypeUnderline, 2)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationPopup.py

 class TestPDFAnnotationPopup (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFAnnotationPopup.isOpen)
-        self.failUnlessArgIsBOOL(PDFAnnotationPopup.setIsOpen_, 0)
+        self.assertResultIsBOOL(PDFAnnotationPopup.isOpen)
+        self.assertArgIsBOOL(PDFAnnotationPopup.setIsOpen_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationText.py

 
 class TestPDFAnnotationText (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kPDFTextAnnotationIconComment, 0)
-        self.failUnlessEqual(kPDFTextAnnotationIconKey, 1)
-        self.failUnlessEqual(kPDFTextAnnotationIconNote, 2)
-        self.failUnlessEqual(kPDFTextAnnotationIconHelp, 3)
-        self.failUnlessEqual(kPDFTextAnnotationIconNewParagraph, 4)
-        self.failUnlessEqual(kPDFTextAnnotationIconParagraph, 5)
-        self.failUnlessEqual(kPDFTextAnnotationIconInsert, 6)
+        self.assertEqual(kPDFTextAnnotationIconComment, 0)
+        self.assertEqual(kPDFTextAnnotationIconKey, 1)
+        self.assertEqual(kPDFTextAnnotationIconNote, 2)
+        self.assertEqual(kPDFTextAnnotationIconHelp, 3)
+        self.assertEqual(kPDFTextAnnotationIconNewParagraph, 4)
+        self.assertEqual(kPDFTextAnnotationIconParagraph, 5)
+        self.assertEqual(kPDFTextAnnotationIconInsert, 6)
 
-        self.failUnlessEqual(kPDFDocumentPermissionsNone, 0)
-        self.failUnlessEqual(kPDFDocumentPermissionsUser, 1)
-        self.failUnlessEqual(kPDFDocumentPermissionsOwner, 2)
+        self.assertEqual(kPDFDocumentPermissionsNone, 0)
+        self.assertEqual(kPDFDocumentPermissionsUser, 1)
+        self.assertEqual(kPDFDocumentPermissionsOwner, 2)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFBorder.py

 
 class TestPDFBorder (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kPDFBorderStyleSolid, 0)
-        self.failUnlessEqual(kPDFBorderStyleDashed, 1)
-        self.failUnlessEqual(kPDFBorderStyleBeveled, 2)
-        self.failUnlessEqual(kPDFBorderStyleInset, 3)
-        self.failUnlessEqual(kPDFBorderStyleUnderline, 4)
+        self.assertEqual(kPDFBorderStyleSolid, 0)
+        self.assertEqual(kPDFBorderStyleDashed, 1)
+        self.assertEqual(kPDFBorderStyleBeveled, 2)
+        self.assertEqual(kPDFBorderStyleInset, 3)
+        self.assertEqual(kPDFBorderStyleUnderline, 4)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFOutline.py

 class TestPDFOutline (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFOutline.isOpen)
-        self.failUnlessArgIsBOOL(PDFOutline.setIsOpen_, 0)
+        self.assertResultIsBOOL(PDFOutline.isOpen)
+        self.assertArgIsBOOL(PDFOutline.setIsOpen_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFSelection.py

 
 class TestPDFSelection (TestCase):
     def testMethods(self):
-        self.failUnlessArgIsBOOL(PDFSelection.drawForPage_withBox_active_, 2)
+        self.assertArgIsBOOL(PDFSelection.drawForPage_withBox_active_, 2)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_PDFThumbnailView.py

 class TestPDFThumbnailView (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(PDFThumbnailView.allowsDragging)
-        self.failUnlessArgIsBOOL(PDFThumbnailView.setAllowsDragging_, 0)
-        self.failUnlessResultIsBOOL(PDFThumbnailView.allowsMultipleSelection)
-        self.failUnlessArgIsBOOL(PDFThumbnailView.setAllowsMultipleSelection_, 0)
+        self.assertResultIsBOOL(PDFThumbnailView.allowsDragging)
+        self.assertArgIsBOOL(PDFThumbnailView.setAllowsDragging_, 0)
+        self.assertResultIsBOOL(PDFThumbnailView.allowsMultipleSelection)
+        self.assertArgIsBOOL(PDFThumbnailView.setAllowsMultipleSelection_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_caanimation.py

 class TestCAAnimation (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(CAAnimation.shouldArchiveValueForKey_)
-        self.failUnlessResultIsBOOL(CAAnimation.isRemovedOnCompletion)
-        self.failUnlessArgIsBOOL(CAAnimation.setRemovedOnCompletion_, 0)
+        self.assertResultIsBOOL(CAAnimation.shouldArchiveValueForKey_)
+        self.assertResultIsBOOL(CAAnimation.isRemovedOnCompletion)
+        self.assertArgIsBOOL(CAAnimation.setRemovedOnCompletion_, 0)
 
-        self.failUnlessArgIsBOOL(TestCAAnimationHelper.animationDidStop_finished_, 1)
+        self.assertArgIsBOOL(TestCAAnimationHelper.animationDidStop_finished_, 1)
 
-        self.failUnlessResultIsBOOL(CAPropertyAnimation.isAdditive)
-        self.failUnlessArgIsBOOL(CAPropertyAnimation.setAdditive_, 0)
+        self.assertResultIsBOOL(CAPropertyAnimation.isAdditive)
+        self.assertArgIsBOOL(CAPropertyAnimation.setAdditive_, 0)
 
-        self.failUnlessResultIsBOOL(CAPropertyAnimation.isCumulative)
-        self.failUnlessArgIsBOOL(CAPropertyAnimation.setCumulative_, 0)
+        self.assertResultIsBOOL(CAPropertyAnimation.isCumulative)
+        self.assertArgIsBOOL(CAPropertyAnimation.setCumulative_, 0)
 
     @min_os_level('10.5')
     def testConstants10_5(self):
-        self.failUnlessIsInstance(kCAAnimationLinear, unicode)
-        self.failUnlessIsInstance(kCAAnimationDiscrete, unicode)
-        self.failUnlessIsInstance(kCAAnimationPaced, unicode)
+        self.assertIsInstance(kCAAnimationLinear, unicode)
+        self.assertIsInstance(kCAAnimationDiscrete, unicode)
+        self.assertIsInstance(kCAAnimationPaced, unicode)
 
-        self.failUnlessIsInstance(kCATransitionFade, unicode)
-        self.failUnlessIsInstance(kCATransitionMoveIn, unicode)
-        self.failUnlessIsInstance(kCATransitionPush, unicode)
-        self.failUnlessIsInstance(kCATransitionReveal, unicode)
-        self.failUnlessIsInstance(kCATransitionFromRight, unicode)
-        self.failUnlessIsInstance(kCATransitionFromLeft, unicode)
-        self.failUnlessIsInstance(kCATransitionFromTop, unicode)
-        self.failUnlessIsInstance(kCATransitionFromBottom, unicode)
+        self.assertIsInstance(kCATransitionFade, unicode)
+        self.assertIsInstance(kCATransitionMoveIn, unicode)
+        self.assertIsInstance(kCATransitionPush, unicode)
+        self.assertIsInstance(kCATransitionReveal, unicode)
+        self.assertIsInstance(kCATransitionFromRight, unicode)
+        self.assertIsInstance(kCATransitionFromLeft, unicode)
+        self.assertIsInstance(kCATransitionFromTop, unicode)
+        self.assertIsInstance(kCATransitionFromBottom, unicode)
 
-        self.failUnlessIsInstance(kCAAnimationRotateAuto, unicode)
-        self.failUnlessIsInstance(kCAAnimationRotateAutoReverse, unicode)
+        self.assertIsInstance(kCAAnimationRotateAuto, unicode)
+        self.assertIsInstance(kCAAnimationRotateAutoReverse, unicode)
 
 
 

File pyobjc-framework-Quartz/PyObjCTest/test_cabase.py

     @min_os_level('10.5')
     def testFunctions(self):
         v = CACurrentMediaTime()
-        self.failUnlessIsInstance(v, float)
+        self.assertIsInstance(v, float)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_cacifilteradditions.py

 
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(CIFilter.isEnabled)
-        self.failUnlessArgIsBOOL(CIFilter.setEnabled_, 0)
+        self.assertResultIsBOOL(CIFilter.isEnabled)
+        self.assertArgIsBOOL(CIFilter.setEnabled_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_caconstraintlayoutmanager.py

 class TestCAConstraintLayoutManager (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessEqual(kCAConstraintMinX, 0)
-        self.failUnlessEqual(kCAConstraintMidX, 1)
-        self.failUnlessEqual(kCAConstraintMaxX, 2)
-        self.failUnlessEqual(kCAConstraintWidth, 3)
-        self.failUnlessEqual(kCAConstraintMinY, 4)
-        self.failUnlessEqual(kCAConstraintMidY, 5)
-        self.failUnlessEqual(kCAConstraintMaxY, 6)
-        self.failUnlessEqual(kCAConstraintHeight, 7)
+        self.assertEqual(kCAConstraintMinX, 0)
+        self.assertEqual(kCAConstraintMidX, 1)
+        self.assertEqual(kCAConstraintMaxX, 2)
+        self.assertEqual(kCAConstraintWidth, 3)
+        self.assertEqual(kCAConstraintMinY, 4)
+        self.assertEqual(kCAConstraintMidY, 5)
+        self.assertEqual(kCAConstraintMaxY, 6)
+        self.assertEqual(kCAConstraintHeight, 7)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_caemittercell.py

 class TestCAEmitterCell (TestCase):
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultIsBOOL(CAEmitterCell.shouldArchiveValueForKey_)
-        self.failUnlessResultIsBOOL(CAEmitterCell.isEnabled)
-        self.failUnlessArgIsBOOL(CAEmitterCell.setEnabled_, 0)
+        self.assertResultIsBOOL(CAEmitterCell.shouldArchiveValueForKey_)
+        self.assertResultIsBOOL(CAEmitterCell.isEnabled)
+        self.assertArgIsBOOL(CAEmitterCell.setEnabled_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_caemitterlayer.py

 class TestCAEmitterLayer (TestCase):
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultHasType(CAEmitterLayer.emitterPosition, CGPoint.__typestr__)
-        self.failUnlessArgHasType(CAEmitterLayer.setEmitterPosition_, 0, CGPoint.__typestr__)
-        self.failUnlessResultHasType(CAEmitterLayer.emitterSize, CGSize.__typestr__)
-        self.failUnlessArgHasType(CAEmitterLayer.setEmitterSize_, 0, CGSize.__typestr__)
+        self.assertResultHasType(CAEmitterLayer.emitterPosition, CGPoint.__typestr__)
+        self.assertArgHasType(CAEmitterLayer.setEmitterPosition_, 0, CGPoint.__typestr__)
+        self.assertResultHasType(CAEmitterLayer.emitterSize, CGSize.__typestr__)
+        self.assertArgHasType(CAEmitterLayer.setEmitterSize_, 0, CGSize.__typestr__)
 
-        self.failUnlessResultIsBOOL(CAEmitterLayer.preservesDepth)
-        self.failUnlessArgIsBOOL(CAEmitterLayer.setPreservesDepth_, 0)
+        self.assertResultIsBOOL(CAEmitterLayer.preservesDepth)
+        self.assertArgIsBOOL(CAEmitterLayer.setPreservesDepth_, 0)
 
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCAEmitterLayerPoint, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerLine, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerRectangle, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerCuboid, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerCircle, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerSphere, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerPoints, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerOutline, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerSurface, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerVolume, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerUnordered, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerOldestFirst, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerOldestLast, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerBackToFront, unicode)
-        self.failUnlessIsInstance(kCAEmitterLayerAdditive, unicode)
+        self.assertIsInstance(kCAEmitterLayerPoint, unicode)
+        self.assertIsInstance(kCAEmitterLayerLine, unicode)
+        self.assertIsInstance(kCAEmitterLayerRectangle, unicode)
+        self.assertIsInstance(kCAEmitterLayerCuboid, unicode)
+        self.assertIsInstance(kCAEmitterLayerCircle, unicode)
+        self.assertIsInstance(kCAEmitterLayerSphere, unicode)
+        self.assertIsInstance(kCAEmitterLayerPoints, unicode)
+        self.assertIsInstance(kCAEmitterLayerOutline, unicode)
+        self.assertIsInstance(kCAEmitterLayerSurface, unicode)
+        self.assertIsInstance(kCAEmitterLayerVolume, unicode)
+        self.assertIsInstance(kCAEmitterLayerUnordered, unicode)
+        self.assertIsInstance(kCAEmitterLayerOldestFirst, unicode)
+        self.assertIsInstance(kCAEmitterLayerOldestLast, unicode)
+        self.assertIsInstance(kCAEmitterLayerBackToFront, unicode)
+        self.assertIsInstance(kCAEmitterLayerAdditive, unicode)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_cagradientlayer.py

 class TestCAGradientLayer (TestCase):
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultHasType(CAGradientLayer.startPoint, CGPoint.__typestr__)
-        self.failUnlessResultHasType(CAGradientLayer.endPoint, CGPoint.__typestr__)
+        self.assertResultHasType(CAGradientLayer.startPoint, CGPoint.__typestr__)
+        self.assertResultHasType(CAGradientLayer.endPoint, CGPoint.__typestr__)
 
-        self.failUnlessArgHasType(CAGradientLayer.setStartPoint_, 0, CGPoint.__typestr__)
-        self.failUnlessArgHasType(CAGradientLayer.setEndPoint_, 0, CGPoint.__typestr__)
+        self.assertArgHasType(CAGradientLayer.setStartPoint_, 0, CGPoint.__typestr__)
+        self.assertArgHasType(CAGradientLayer.setEndPoint_, 0, CGPoint.__typestr__)
 
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCAGradientLayerAxial, unicode)
+        self.assertIsInstance(kCAGradientLayerAxial, unicode)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_calayer.py

 class TestCALayer (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessEqual(kCALayerNotSizable, 0)
-        self.failUnlessEqual(kCALayerMinXMargin, 1)
-        self.failUnlessEqual(kCALayerWidthSizable, 2)
-        self.failUnlessEqual(kCALayerMaxXMargin, 4)
-        self.failUnlessEqual(kCALayerMinYMargin, 8)
-        self.failUnlessEqual(kCALayerHeightSizable, 16)
-        self.failUnlessEqual(kCALayerMaxYMargin, 32)
-        self.failUnlessEqual(kCALayerLeftEdge, 1)
-        self.failUnlessEqual(kCALayerRightEdge, 2)
-        self.failUnlessEqual(kCALayerBottomEdge, 4)
-        self.failUnlessEqual(kCALayerTopEdge, 8)
+        self.assertEqual(kCALayerNotSizable, 0)
+        self.assertEqual(kCALayerMinXMargin, 1)
+        self.assertEqual(kCALayerWidthSizable, 2)
+        self.assertEqual(kCALayerMaxXMargin, 4)
+        self.assertEqual(kCALayerMinYMargin, 8)
+        self.assertEqual(kCALayerHeightSizable, 16)
+        self.assertEqual(kCALayerMaxYMargin, 32)
+        self.assertEqual(kCALayerLeftEdge, 1)
+        self.assertEqual(kCALayerRightEdge, 2)
+        self.assertEqual(kCALayerBottomEdge, 4)
+        self.assertEqual(kCALayerTopEdge, 8)
 
-        self.failUnlessIsInstance(kCAGravityCenter, unicode)
-        self.failUnlessIsInstance(kCAGravityTop, unicode)
-        self.failUnlessIsInstance(kCAGravityBottom, unicode)
-        self.failUnlessIsInstance(kCAGravityLeft, unicode)
-        self.failUnlessIsInstance(kCAGravityRight, unicode)
-        self.failUnlessIsInstance(kCAGravityTopLeft, unicode)
-        self.failUnlessIsInstance(kCAGravityTopRight, unicode)
-        self.failUnlessIsInstance(kCAGravityBottomLeft, unicode)
-        self.failUnlessIsInstance(kCAGravityBottomRight, unicode)
-        self.failUnlessIsInstance(kCAGravityResize, unicode)
-        self.failUnlessIsInstance(kCAGravityResizeAspect, unicode)
-        self.failUnlessIsInstance(kCAGravityResizeAspectFill, unicode)
-        self.failUnlessIsInstance(kCAFilterLinear, unicode)
-        self.failUnlessIsInstance(kCAFilterNearest, unicode)
-        self.failUnlessIsInstance(kCAOnOrderIn, unicode)
-        self.failUnlessIsInstance(kCAOnOrderOut, unicode)
-        self.failUnlessIsInstance(kCATransition, unicode)
+        self.assertIsInstance(kCAGravityCenter, unicode)
+        self.assertIsInstance(kCAGravityTop, unicode)
+        self.assertIsInstance(kCAGravityBottom, unicode)
+        self.assertIsInstance(kCAGravityLeft, unicode)
+        self.assertIsInstance(kCAGravityRight, unicode)
+        self.assertIsInstance(kCAGravityTopLeft, unicode)
+        self.assertIsInstance(kCAGravityTopRight, unicode)
+        self.assertIsInstance(kCAGravityBottomLeft, unicode)
+        self.assertIsInstance(kCAGravityBottomRight, unicode)
+        self.assertIsInstance(kCAGravityResize, unicode)
+        self.assertIsInstance(kCAGravityResizeAspect, unicode)
+        self.assertIsInstance(kCAGravityResizeAspectFill, unicode)
+        self.assertIsInstance(kCAFilterLinear, unicode)
+        self.assertIsInstance(kCAFilterNearest, unicode)
+        self.assertIsInstance(kCAOnOrderIn, unicode)
+        self.assertIsInstance(kCAOnOrderOut, unicode)
+        self.assertIsInstance(kCATransition, unicode)
 
 
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(CALayer.needsDisplayForKey_)
-        self.failUnlessResultIsBOOL(CALayer.shouldArchiveValueForKey_)
-        self.failUnlessResultIsBOOL(CALayer.isHidden)
-        self.failUnlessArgIsBOOL(CALayer.setHidden_, 0)
-        self.failUnlessResultIsBOOL(CALayer.isDoubleSided)
-        self.failUnlessArgIsBOOL(CALayer.setDoubleSided_, 0)
-        self.failUnlessResultIsBOOL(CALayer.masksToBounds)
-        self.failUnlessArgIsBOOL(CALayer.setMasksToBounds_, 0)
-        self.failUnlessResultIsBOOL(CALayer.containsPoint_)
-        self.failUnlessResultIsBOOL(CALayer.isOpaque)
-        self.failUnlessArgIsBOOL(CALayer.setOpaque_, 0)
-        self.failUnlessResultIsBOOL(CALayer.needsDisplayOnBoundsChange)
-        self.failUnlessArgIsBOOL(CALayer.setNeedsDisplayOnBoundsChange_, 0)
+        self.assertResultIsBOOL(CALayer.needsDisplayForKey_)
+        self.assertResultIsBOOL(CALayer.shouldArchiveValueForKey_)
+        self.assertResultIsBOOL(CALayer.isHidden)
+        self.assertArgIsBOOL(CALayer.setHidden_, 0)
+        self.assertResultIsBOOL(CALayer.isDoubleSided)
+        self.assertArgIsBOOL(CALayer.setDoubleSided_, 0)
+        self.assertResultIsBOOL(CALayer.masksToBounds)
+        self.assertArgIsBOOL(CALayer.setMasksToBounds_, 0)
+        self.assertResultIsBOOL(CALayer.containsPoint_)
+        self.assertResultIsBOOL(CALayer.isOpaque)
+        self.assertArgIsBOOL(CALayer.setOpaque_, 0)
+        self.assertResultIsBOOL(CALayer.needsDisplayOnBoundsChange)
+        self.assertArgIsBOOL(CALayer.setNeedsDisplayOnBoundsChange_, 0)
 
-        self.failUnlessResultHasType(TestCALayerHelper.preferredSizeOfLayer_, CGSize.__typestr__)
+        self.assertResultHasType(TestCALayerHelper.preferredSizeOfLayer_, CGSize.__typestr__)
 
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultIsBOOL(CALayer.isGeometryFlipped)
-        self.failUnlessArgIsBOOL(CALayer.setGeometryFlipped_, 0)
-        self.failUnlessResultIsBOOL(CALayer.contentsAreFlipped)
+        self.assertResultIsBOOL(CALayer.isGeometryFlipped)
+        self.assertArgIsBOOL(CALayer.setGeometryFlipped_, 0)
+        self.assertResultIsBOOL(CALayer.contentsAreFlipped)
 
-        self.failUnlessResultHasType(CALayer.contentsCenter, CGRect.__typestr__)
-        self.failUnlessArgHasType(CALayer.setContentsCenter_, 0, CGRect.__typestr__)
-        self.failUnlessResultIsBOOL(CALayer.needsDisplay)
-        self.failUnlessResultIsBOOL(CALayer.needsLayout)
+        self.assertResultHasType(CALayer.contentsCenter, CGRect.__typestr__)
+        self.assertArgHasType(CALayer.setContentsCenter_, 0, CGRect.__typestr__)
+        self.assertResultIsBOOL(CALayer.needsDisplay)
+        self.assertResultIsBOOL(CALayer.needsLayout)
     
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCAFilterTrilinear, unicode)
+        self.assertIsInstance(kCAFilterTrilinear, unicode)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_camediatiming.py

 class TestCAMediaTiming (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(kCAFillModeForwards, unicode)
-        self.failUnlessIsInstance(kCAFillModeBackwards, unicode)
-        self.failUnlessIsInstance(kCAFillModeBoth, unicode)
-        self.failUnlessIsInstance(kCAFillModeRemoved, unicode)
+        self.assertIsInstance(kCAFillModeForwards, unicode)
+        self.assertIsInstance(kCAFillModeBackwards, unicode)
+        self.assertIsInstance(kCAFillModeBoth, unicode)
+        self.assertIsInstance(kCAFillModeRemoved, unicode)
 
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.beginTime, objc._C_DBL)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setBeginTime_, 0, objc._C_DBL)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.duration, objc._C_DBL)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setDuration_, 0, objc._C_DBL)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.speed, objc._C_FLT)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setSpeed_, 0, objc._C_FLT)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.timeOffset, objc._C_DBL)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setTimeOffset_, 0, objc._C_DBL)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.repeatCount, objc._C_FLT)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setRepeatCount_, 0, objc._C_FLT)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.repeatDuration, objc._C_DBL)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setRepeatDuration_, 0, objc._C_DBL)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.autoreverses, objc._C_NSBOOL)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setAutoreverses_, 0, objc._C_NSBOOL)
-        self.failUnlessResultHasType(TestCAMediaTimingHelper.fillMode, objc._C_ID)
-        self.failUnlessArgHasType(TestCAMediaTimingHelper.setFillMode_, 0, objc._C_ID)
+        self.assertResultHasType(TestCAMediaTimingHelper.beginTime, objc._C_DBL)
+        self.assertArgHasType(TestCAMediaTimingHelper.setBeginTime_, 0, objc._C_DBL)
+        self.assertResultHasType(TestCAMediaTimingHelper.duration, objc._C_DBL)
+        self.assertArgHasType(TestCAMediaTimingHelper.setDuration_, 0, objc._C_DBL)
+        self.assertResultHasType(TestCAMediaTimingHelper.speed, objc._C_FLT)
+        self.assertArgHasType(TestCAMediaTimingHelper.setSpeed_, 0, objc._C_FLT)
+        self.assertResultHasType(TestCAMediaTimingHelper.timeOffset, objc._C_DBL)
+        self.assertArgHasType(TestCAMediaTimingHelper.setTimeOffset_, 0, objc._C_DBL)
+        self.assertResultHasType(TestCAMediaTimingHelper.repeatCount, objc._C_FLT)
+        self.assertArgHasType(TestCAMediaTimingHelper.setRepeatCount_, 0, objc._C_FLT)
+        self.assertResultHasType(TestCAMediaTimingHelper.repeatDuration, objc._C_DBL)
+        self.assertArgHasType(TestCAMediaTimingHelper.setRepeatDuration_, 0, objc._C_DBL)
+        self.assertResultHasType(TestCAMediaTimingHelper.autoreverses, objc._C_NSBOOL)
+        self.assertArgHasType(TestCAMediaTimingHelper.setAutoreverses_, 0, objc._C_NSBOOL)
+        self.assertResultHasType(TestCAMediaTimingHelper.fillMode, objc._C_ID)
+        self.assertArgHasType(TestCAMediaTimingHelper.setFillMode_, 0, objc._C_ID)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_camediatimingfunction.py

 class TestCAMediaTimingFunction (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(kCAMediaTimingFunctionLinear, unicode)
-        self.failUnlessIsInstance(kCAMediaTimingFunctionEaseIn, unicode)
-        self.failUnlessIsInstance(kCAMediaTimingFunctionEaseOut, unicode)
-        self.failUnlessIsInstance(kCAMediaTimingFunctionEaseInEaseOut, unicode)
+        self.assertIsInstance(kCAMediaTimingFunctionLinear, unicode)
+        self.assertIsInstance(kCAMediaTimingFunctionEaseIn, unicode)
+        self.assertIsInstance(kCAMediaTimingFunctionEaseOut, unicode)
+        self.assertIsInstance(kCAMediaTimingFunctionEaseInEaseOut, unicode)
 
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCAMediaTimingFunctionDefault, unicode)
+        self.assertIsInstance(kCAMediaTimingFunctionDefault, unicode)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_caopengllayer.py

 class TestCAOpenGLLayer (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(CAOpenGLLayer.isAsynchronous)
-        self.failUnlessArgIsBOOL(CAOpenGLLayer.setAsynchronous_, 0)
+        self.assertResultIsBOOL(CAOpenGLLayer.isAsynchronous)
+        self.assertArgIsBOOL(CAOpenGLLayer.setAsynchronous_, 0)
 
-        self.failUnlessResultIsBOOL(CAOpenGLLayer.canDrawInCGLContext_pixelFormat_forLayerTime_displayTime_)
-        self.failUnlessArgIsIn(CAOpenGLLayer.canDrawInCGLContext_pixelFormat_forLayerTime_displayTime_, 3)
+        self.assertResultIsBOOL(CAOpenGLLayer.canDrawInCGLContext_pixelFormat_forLayerTime_displayTime_)
+        self.assertArgIsIn(CAOpenGLLayer.canDrawInCGLContext_pixelFormat_forLayerTime_displayTime_, 3)
 
-        self.failUnlessArgIsIn(CAOpenGLLayer.drawInCGLContext_pixelFormat_forLayerTime_displayTime_, 3)
+        self.assertArgIsIn(CAOpenGLLayer.drawInCGLContext_pixelFormat_forLayerTime_displayTime_, 3)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_carenderer.py

 class TestCARenderer (TestCase):
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessArgHasType(CARenderer.rendererWithCGLContext_options_, 0, '^{_CGLContextObject=}')
-        self.failUnlessArgIsIn(CARenderer.beginFrameAtTime_timeStamp_, 1)
+        self.assertArgHasType(CARenderer.rendererWithCGLContext_options_, 0, b'^{_CGLContextObject=}')
+        self.assertArgIsIn(CARenderer.beginFrameAtTime_timeStamp_, 1)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_careplicatorlayer.py

 class TestCAReplicatorLayer (TestCase):
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultIsBOOL(CAReplicatorLayer.preservesDepth)
-        self.failUnlessArgIsBOOL(CAReplicatorLayer.setPreservesDepth_, 0)
+        self.assertResultIsBOOL(CAReplicatorLayer.preservesDepth)
+        self.assertArgIsBOOL(CAReplicatorLayer.setPreservesDepth_, 0)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_cascrolllayer.py

 class TestCAScrollLayer (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(kCAScrollNone, unicode)
-        self.failUnlessIsInstance(kCAScrollVertically, unicode)
-        self.failUnlessIsInstance(kCAScrollHorizontally, unicode)
-        self.failUnlessIsInstance(kCAScrollBoth, unicode)
+        self.assertIsInstance(kCAScrollNone, unicode)
+        self.assertIsInstance(kCAScrollVertically, unicode)
+        self.assertIsInstance(kCAScrollHorizontally, unicode)
+        self.assertIsInstance(kCAScrollBoth, unicode)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_cashapelayer.py

 class TestCAShapeLayer (TestCase):
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCAFillRuleNonZero, unicode)
-        self.failUnlessIsInstance(kCAFillRuleEvenOdd, unicode)
-        self.failUnlessIsInstance(kCALineJoinMiter, unicode)
-        self.failUnlessIsInstance(kCALineJoinRound, unicode)
-        self.failUnlessIsInstance(kCALineJoinRound, unicode)
-        self.failUnlessIsInstance(kCALineCapButt, unicode)
-        self.failUnlessIsInstance(kCALineCapRound, unicode)
-        self.failUnlessIsInstance(kCALineCapSquare, unicode)
+        self.assertIsInstance(kCAFillRuleNonZero, unicode)
+        self.assertIsInstance(kCAFillRuleEvenOdd, unicode)
+        self.assertIsInstance(kCALineJoinMiter, unicode)
+        self.assertIsInstance(kCALineJoinRound, unicode)
+        self.assertIsInstance(kCALineJoinRound, unicode)
+        self.assertIsInstance(kCALineCapButt, unicode)
+        self.assertIsInstance(kCALineCapRound, unicode)
+        self.assertIsInstance(kCALineCapSquare, unicode)
 
 if __name__ == "__main__":
     main()

File pyobjc-framework-Quartz/PyObjCTest/test_catextlayer.py

 
     @min_os_level('10.5')
     def testMethods(self):
-        self.failUnlessResultIsBOOL(CATextLayer.isWrapped)
-        self.failUnlessArgIsBOOL(CATextLayer.setWrapped_, 0)
+        self.assertResultIsBOOL(CATextLayer.isWrapped)
+        self.assertArgIsBOOL(CATextLayer.setWrapped_, 0)
 
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(kCATruncationNone, unicode)
-        self.failUnlessIsInstance(kCATruncationStart, unicode)
-        self.failUnlessIsInstance(kCATruncationEnd, unicode)
-        self.failUnlessIsInstance(kCATruncationMiddle, unicode)
-        self.failUnlessIsInstance(kCAAlignmentNatural, unicode)
-        self.failUnlessIsInstance(kCAAlignmentLeft, unicode)
-        self.failUnlessIsInstance(kCAAlignmentRight, unicode)
-        self.failUnlessIsInstance(kCAAlignmentCenter, unicode)
-        self.failUnlessIsInstance(kCAAlignmentJustified, unicode)
+        self.assertIsInstance(kCATruncationNone, unicode)
+        self.assertIsInstance(kCATruncationStart, unicode)
+        self.assertIsInstance(kCATruncationEnd, unicode)
+        self.assertIsInstance(kCATruncationMiddle, unicode)
+        self.assertIsInstance(kCAAlignmentNatural, unicode)
+        self.assertIsInstance(kCAAlignmentLeft, unicode)
+        self.assertIsInstance(kCAAlignmentRight, unicode)
+        self.assertIsInstance(kCAAlignmentCenter, unicode)
+        self.assertIsInstance(kCAAlignmentJustified, unicode)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_catransaction.py

 class TestCATransaction (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(kCATransactionAnimationDuration, unicode)
-        self.failUnlessIsInstance(kCATransactionDisableActions, unicode)
+        self.assertIsInstance(kCATransactionAnimationDuration, unicode)
+        self.assertIsInstance(kCATransactionDisableActions, unicode)
 
     @min_os_level('10.6')
     def testMethods10_6(self):
-        self.failUnlessResultIsBOOL(CATransaction.disableActions)
-        self.failUnlessArgIsBOOL(CATransaction.setDisableActions_, 0)
+        self.assertResultIsBOOL(CATransaction.disableActions)
+        self.assertArgIsBOOL(CATransaction.setDisableActions_, 0)
 
-        self.failUnlessResultIsBlock(CATransaction.completionBlock, 'v')
-        self.failUnlessArgIsBlock(CATransaction.setCompletionBlock_, 0, 'v')
+        self.assertResultIsBlock(CATransaction.completionBlock, b'v')
+        self.assertArgIsBlock(CATransaction.setCompletionBlock_, 0, b'v')
 
     @min_os_level('10.6')
     def testConstants10_6(self):
-        self.failUnlessIsInstance(kCATransactionAnimationTimingFunction, unicode)
-        self.failUnlessIsInstance(kCATransactionCompletionBlock, unicode)
+        self.assertIsInstance(kCATransactionAnimationTimingFunction, unicode)
+        self.assertIsInstance(kCATransactionCompletionBlock, unicode)
 
 
 if __name__ == "__main__":

File pyobjc-framework-Quartz/PyObjCTest/test_catransform3d.py

     @min_os_level('10.5')
     def testStructs(self):
         v = CATransform3D()
-        self.failUnlessIsInstance(v.m11, float)
-        self.failUnlessIsInstance(v.m12, float)
-        self.failUnlessIsInstance(v.m13, float)
-        self.failUnlessIsInstance(v.m14, float)
+        self.assertIsInstance(v.m11, float)
+        self.assertIsInstance(v.m12, float)
+        self.assertIsInstance(v.m13, float)
+        self.assertIsInstance(v.m14, float)
 
-        self.failUnlessIsInstance(v.m21, float)
-        self.failUnlessIsInstance(v.m22, float)
-        self.failUnlessIsInstance(v.m23, float)
-        self.failUnlessIsInstance(v.m24, float)
+        self.assertIsInstance(v.m21, float)
+        self.assertIsInstance(v.m22, float)
+        self.assertIsInstance(v.m23, float)
+        self.assertIsInstance(v.m24, float)
 
-        self.failUnlessIsInstance(v.m31, float)
-        self.failUnlessIsInstance(v.m32, float)
-        self.failUnlessIsInstance(v.m33, float)
-        self.failUnlessIsInstance(v.m34, float)