Commits

Ronald Oussoren committed 6191e4f

Port to py3k

  • Participants
  • Parent commits df565d1
  • Branches pyobjc-ancient

Comments (0)

Files changed (20)

pyobjc-framework-QTKit/PyObjCTest/test_QTCaptureDecompressedVideoOutput.py

 
 class TestQTCaptureDecompressedVideoOutput (TestCase):
     def testInformalProtocols(self):
-        self.failUnlessIsInstance(protocols.QTCaptureDecompressedVideoOutputDelegate, objc.informal_protocol)
+        self.assertIsInstance(protocols.QTCaptureDecompressedVideoOutputDelegate, objc.informal_protocol)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_QTCaptureFileOutput.py

 
 class TestQTCaptureFileOutput (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(QTCaptureFileOutputBufferDestinationNewFile, 1)
-        self.failUnlessEqual(QTCaptureFileOutputBufferDestinationOldFile, 2)
+        self.assertEqual(QTCaptureFileOutputBufferDestinationNewFile, 1)
+        self.assertEqual(QTCaptureFileOutputBufferDestinationOldFile, 2)
 
     def testProtocols(self):
-        self.failUnlessResultIsBOOL(TestQTCaptureFileOutputHelper.captureOutput_shouldChangeOutputFileAtURL_forConnections_dueToError_)
+        self.assertResultIsBOOL(TestQTCaptureFileOutputHelper.captureOutput_shouldChangeOutputFileAtURL_forConnections_dueToError_)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_QTCaptureSession.py

 
 class TestQTCaptureSession (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTCaptureSessionRuntimeErrorNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureSessionErrorKey, unicode)
+        self.assertIsInstance(QTCaptureSessionRuntimeErrorNotification, unicode)
+        self.assertIsInstance(QTCaptureSessionErrorKey, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTCaptureSession.addInput_error_)
-        self.failUnlessArgIsOut(QTCaptureSession.addInput_error_, 1)
-        self.failUnlessResultIsBOOL(QTCaptureSession.addOutput_error_)
-        self.failUnlessArgIsOut(QTCaptureSession.addOutput_error_, 1)
-        self.failUnlessResultIsBOOL(QTCaptureSession.isRunning)
+        self.assertResultIsBOOL(QTCaptureSession.addInput_error_)
+        self.assertArgIsOut(QTCaptureSession.addInput_error_, 1)
+        self.assertResultIsBOOL(QTCaptureSession.addOutput_error_)
+        self.assertArgIsOut(QTCaptureSession.addOutput_error_, 1)
+        self.assertResultIsBOOL(QTCaptureSession.isRunning)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_QTCaptureView.py

 
 class TestQTCaptureView (TestCase):
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTCaptureView.preservesAspectRatio)
+        self.assertResultIsBOOL(QTCaptureView.preservesAspectRatio)
 
     def testProtocols(self):
-        self.failUnlessIsInstance(protocols.QTCaptureViewDelegate, objc.informal_protocol)
+        self.assertIsInstance(protocols.QTCaptureViewDelegate, objc.informal_protocol)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_QTCompressionOptions.py

 
 class TestQTCompressionOptions (TestCase):
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTCompressionOptions.isEqualToCompressionOptions_)
+        self.assertResultIsBOOL(QTCompressionOptions.isEqualToCompressionOptions_)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_QTMovieView.py

 
 class TestQTMovieView (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTMovieViewMovieBinding, unicode)
-        self.failUnlessIsInstance(QTMovieViewControllerVisibleBinding, unicode)
-        self.failUnlessIsInstance(QTMovieViewPreservesAspectRatioBinding, unicode)
-        self.failUnlessIsInstance(QTMovieViewFillColorBinding, unicode)
+        self.assertIsInstance(QTMovieViewMovieBinding, unicode)
+        self.assertIsInstance(QTMovieViewControllerVisibleBinding, unicode)
+        self.assertIsInstance(QTMovieViewPreservesAspectRatioBinding, unicode)
+        self.assertIsInstance(QTMovieViewFillColorBinding, unicode)
 
     def testProtocols(self):
-        self.failUnlessIsInstance(protocols.QTMovieViewDelegate, objc.informal_protocol)
+        self.assertIsInstance(protocols.QTMovieViewDelegate, objc.informal_protocol)
 
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTMovieView.isControllerVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.isEditable)
-        self.failUnlessResultIsBOOL(QTMovieView.preservesAspectRatio)
-        self.failUnlessArgIsBOOL(QTMovieView.setControllerVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setPreservesAspectRatio_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setEditable_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setShowsResizeIndicator_, 0)
+        self.assertResultIsBOOL(QTMovieView.isControllerVisible)
+        self.assertResultIsBOOL(QTMovieView.isEditable)
+        self.assertResultIsBOOL(QTMovieView.preservesAspectRatio)
+        self.assertArgIsBOOL(QTMovieView.setControllerVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setPreservesAspectRatio_, 0)
+        self.assertArgIsBOOL(QTMovieView.setEditable_, 0)
+        self.assertArgIsBOOL(QTMovieView.setShowsResizeIndicator_, 0)
 
-        self.failUnlessArgIsBOOL(QTMovieView.setBackButtonVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setCustomButtonVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setHotSpotButtonVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setStepButtonsVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setTranslateButtonVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setVolumeButtonVisible_, 0)
-        self.failUnlessArgIsBOOL(QTMovieView.setZoomButtonsVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setBackButtonVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setCustomButtonVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setHotSpotButtonVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setStepButtonsVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setTranslateButtonVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setVolumeButtonVisible_, 0)
+        self.assertArgIsBOOL(QTMovieView.setZoomButtonsVisible_, 0)
 
-        self.failUnlessResultIsBOOL(QTMovieView.isBackButtonVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.isCustomButtonVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.isHotSpotButtonVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.areStepButtonsVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.isTranslateButtonVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.isVolumeButtonVisible)
-        self.failUnlessResultIsBOOL(QTMovieView.areZoomButtonsVisible)
+        self.assertResultIsBOOL(QTMovieView.isBackButtonVisible)
+        self.assertResultIsBOOL(QTMovieView.isCustomButtonVisible)
+        self.assertResultIsBOOL(QTMovieView.isHotSpotButtonVisible)
+        self.assertResultIsBOOL(QTMovieView.areStepButtonsVisible)
+        self.assertResultIsBOOL(QTMovieView.isTranslateButtonVisible)
+        self.assertResultIsBOOL(QTMovieView.isVolumeButtonVisible)
+        self.assertResultIsBOOL(QTMovieView.areZoomButtonsVisible)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qtcaptureconnection.py

 class TestQTCaptureConnection (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(QTCaptureConnectionFormatDescriptionWillChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionFormatDescriptionDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAttributeWillChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAttributeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionChangedAttributeKey, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAudioAveragePowerLevelsAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAudioPeakHoldLevelsAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAudioMasterVolumeAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionAudioVolumesAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureConnectionEnabledAudioChannelsAttribute, unicode)
+        self.assertIsInstance(QTCaptureConnectionFormatDescriptionWillChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureConnectionFormatDescriptionDidChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureConnectionAttributeWillChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureConnectionAttributeDidChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureConnectionChangedAttributeKey, unicode)
+        self.assertIsInstance(QTCaptureConnectionAudioAveragePowerLevelsAttribute, unicode)
+        self.assertIsInstance(QTCaptureConnectionAudioPeakHoldLevelsAttribute, unicode)
+        self.assertIsInstance(QTCaptureConnectionAudioMasterVolumeAttribute, unicode)
+        self.assertIsInstance(QTCaptureConnectionAudioVolumesAttribute, unicode)
+        self.assertIsInstance(QTCaptureConnectionEnabledAudioChannelsAttribute, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTCaptureConnection.isEnabled)
-        self.failUnlessArgIsBOOL(QTCaptureConnection.setEnabled_, 0)
-        self.failUnlessResultIsBOOL(QTCaptureConnection.attributeIsReadOnly_)
+        self.assertResultIsBOOL(QTCaptureConnection.isEnabled)
+        self.assertArgIsBOOL(QTCaptureConnection.setEnabled_, 0)
+        self.assertResultIsBOOL(QTCaptureConnection.attributeIsReadOnly_)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_qtcapturedevice.py

 class TestQTCaptureDevice (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(QTCaptureDeviceWasConnectedNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceWasDisconnectedNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceFormatDescriptionsWillChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceFormatDescriptionsDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAttributeWillChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAttributeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceChangedAttributeKey, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceSuspendedAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceLinkedDevicesAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAvailableInputSourcesAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceInputSourceIdentifierAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceInputSourceIdentifierKey, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceInputSourceLocalizedDisplayNameKey, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceInputSourceLocalizedDisplayNameKey, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAVCTransportControlsAttribute, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAVCTransportControlsPlaybackModeKey, unicode)
-        self.failUnlessIsInstance(QTCaptureDeviceAVCTransportControlsSpeedKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceWasConnectedNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceWasDisconnectedNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceFormatDescriptionsWillChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceFormatDescriptionsDidChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceAttributeWillChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceAttributeDidChangeNotification, unicode)
+        self.assertIsInstance(QTCaptureDeviceChangedAttributeKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceSuspendedAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceLinkedDevicesAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceAvailableInputSourcesAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceInputSourceIdentifierAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceInputSourceIdentifierKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceInputSourceLocalizedDisplayNameKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceInputSourceLocalizedDisplayNameKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceAVCTransportControlsAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceAVCTransportControlsPlaybackModeKey, unicode)
+        self.assertIsInstance(QTCaptureDeviceAVCTransportControlsSpeedKey, unicode)
 
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsNotPlayingMode, 0)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsPlayingMode, 1)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsFastestReverseSpeed, -19000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsVeryFastReverseSpeed, -16000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsFastReverseSpeed, -13000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsNormalReverseSpeed, -10000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsSlowReverseSpeed, -7000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsVerySlowReverseSpeed, -4000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsSlowestReverseSpeed, -1000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsStoppedSpeed, 0)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsSlowestForwardSpeed, 1000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsVerySlowForwardSpeed, 4000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsSlowForwardSpeed, 7000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsNormalForwardSpeed, 10000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsFastForwardSpeed, 13000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsVeryFastForwardSpeed, 16000)
-        self.failUnlessEqual(QTCaptureDeviceAVCTransportControlsFastestForwardSpeed, 19000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsNotPlayingMode, 0)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsPlayingMode, 1)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsFastestReverseSpeed, -19000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsVeryFastReverseSpeed, -16000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsFastReverseSpeed, -13000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsNormalReverseSpeed, -10000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsSlowReverseSpeed, -7000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsVerySlowReverseSpeed, -4000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsSlowestReverseSpeed, -1000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsStoppedSpeed, 0)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsSlowestForwardSpeed, 1000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsVerySlowForwardSpeed, 4000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsSlowForwardSpeed, 7000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsNormalForwardSpeed, 10000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsFastForwardSpeed, 13000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsVeryFastForwardSpeed, 16000)
+        self.assertEqual(QTCaptureDeviceAVCTransportControlsFastestForwardSpeed, 19000)
 
 
     @min_os_level('10.5')
     @onlyOn32Bit
     def testConstants32bit(self):
-        self.failUnlessIsInstance(QTCaptureDeviceLegacySequenceGrabberAttribute, unicode)
+        self.assertIsInstance(QTCaptureDeviceLegacySequenceGrabberAttribute, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTCaptureDevice.hasMediaType_)
-        self.failUnlessResultIsBOOL(QTCaptureDevice.attributeIsReadOnly_)
-        self.failUnlessResultIsBOOL(QTCaptureDevice.isConnected)
-        self.failUnlessResultIsBOOL(QTCaptureDevice.isInUseByAnotherApplication)
-        self.failUnlessResultIsBOOL(QTCaptureDevice.isOpen)
-        self.failUnlessResultIsBOOL(QTCaptureDevice.open_)
-        self.failUnlessArgIsOut(QTCaptureDevice.open_, 0)
+        self.assertResultIsBOOL(QTCaptureDevice.hasMediaType_)
+        self.assertResultIsBOOL(QTCaptureDevice.attributeIsReadOnly_)
+        self.assertResultIsBOOL(QTCaptureDevice.isConnected)
+        self.assertResultIsBOOL(QTCaptureDevice.isInUseByAnotherApplication)
+        self.assertResultIsBOOL(QTCaptureDevice.isOpen)
+        self.assertResultIsBOOL(QTCaptureDevice.open_)
+        self.assertArgIsOut(QTCaptureDevice.open_, 0)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_qtdatareference.py

 
 class TestQTDataReference (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTDataReferenceTypeFile, unicode)
-        self.failUnlessIsInstance(QTDataReferenceTypeHandle, unicode)
-        self.failUnlessIsInstance(QTDataReferenceTypePointer, unicode)
-        self.failUnlessIsInstance(QTDataReferenceTypeResource, unicode)
-        self.failUnlessIsInstance(QTDataReferenceTypeURL, unicode)
+        self.assertIsInstance(QTDataReferenceTypeFile, unicode)
+        self.assertIsInstance(QTDataReferenceTypeHandle, unicode)
+        self.assertIsInstance(QTDataReferenceTypePointer, unicode)
+        self.assertIsInstance(QTDataReferenceTypeResource, unicode)
+        self.assertIsInstance(QTDataReferenceTypeURL, unicode)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qterror.py

 class TestQTError (TestCase):
     @min_os_level('10.5')
     def testConstants(self):
-        self.failUnlessIsInstance(QTKitErrorDomain, unicode)
-        self.failUnlessIsInstance(QTErrorCaptureInputKey, unicode)
-        self.failUnlessIsInstance(QTErrorCaptureOutputKey, unicode)
-        self.failUnlessIsInstance(QTErrorDeviceKey, unicode)
-        self.failUnlessIsInstance(QTErrorExcludingDeviceKey, unicode)
-        self.failUnlessIsInstance(QTErrorRecordingSuccesfullyFinishedKey, unicode)
+        self.assertIsInstance(QTKitErrorDomain, unicode)
+        self.assertIsInstance(QTErrorCaptureInputKey, unicode)
+        self.assertIsInstance(QTErrorCaptureOutputKey, unicode)
+        self.assertIsInstance(QTErrorDeviceKey, unicode)
+        self.assertIsInstance(QTErrorExcludingDeviceKey, unicode)
+        self.assertIsInstance(QTErrorRecordingSuccesfullyFinishedKey, unicode)
 
-        self.failUnlessEqual(QTErrorUnknown, -1)
-        self.failUnlessEqual(QTErrorIncompatibleInput, 1002)
-        self.failUnlessEqual(QTErrorIncompatibleOutput, 1003)
-        self.failUnlessEqual(QTErrorInvalidInputsOrOutputs, 1100)
-        self.failUnlessEqual(QTErrorDeviceAlreadyUsedbyAnotherSession, 1101)
-        self.failUnlessEqual(QTErrorNoDataCaptured, 1200)
-        self.failUnlessEqual(QTErrorSessionConfigurationChanged, 1201)
-        self.failUnlessEqual(QTErrorDiskFull, 1202)
-        self.failUnlessEqual(QTErrorDeviceWasDisconnected, 1203)
-        self.failUnlessEqual(QTErrorMediaChanged, 1204)
-        self.failUnlessEqual(QTErrorMaximumDurationReached, 1205)
-        self.failUnlessEqual(QTErrorMaximumFileSizeReached, 1206)
-        self.failUnlessEqual(QTErrorMediaDiscontinuity, 1207)
-        self.failUnlessEqual(QTErrorDeviceNotConnected, 1300)
-        self.failUnlessEqual(QTErrorDeviceInUseByAnotherApplication, 1301)
-        self.failUnlessEqual(QTErrorDeviceExcludedByAnotherDevice, 1302)
+        self.assertEqual(QTErrorUnknown, -1)
+        self.assertEqual(QTErrorIncompatibleInput, 1002)
+        self.assertEqual(QTErrorIncompatibleOutput, 1003)
+        self.assertEqual(QTErrorInvalidInputsOrOutputs, 1100)
+        self.assertEqual(QTErrorDeviceAlreadyUsedbyAnotherSession, 1101)
+        self.assertEqual(QTErrorNoDataCaptured, 1200)
+        self.assertEqual(QTErrorSessionConfigurationChanged, 1201)
+        self.assertEqual(QTErrorDiskFull, 1202)
+        self.assertEqual(QTErrorDeviceWasDisconnected, 1203)
+        self.assertEqual(QTErrorMediaChanged, 1204)
+        self.assertEqual(QTErrorMaximumDurationReached, 1205)
+        self.assertEqual(QTErrorMaximumFileSizeReached, 1206)
+        self.assertEqual(QTErrorMediaDiscontinuity, 1207)
+        self.assertEqual(QTErrorDeviceNotConnected, 1300)
+        self.assertEqual(QTErrorDeviceInUseByAnotherApplication, 1301)
+        self.assertEqual(QTErrorDeviceExcludedByAnotherDevice, 1302)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qtformatdescription.py

 
 class TestQTFormatDescription (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTFormatDescriptionAudioStreamBasicDescriptionAttribute, unicode)
-        self.failUnlessIsInstance(QTFormatDescriptionAudioMagicCookieAttribute, unicode)
-        self.failUnlessIsInstance(QTFormatDescriptionAudioChannelLayoutAttribute, unicode)
-        self.failUnlessIsInstance(QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute, unicode)
-        self.failUnlessIsInstance(QTFormatDescriptionVideoProductionApertureDisplaySizeAttribute, unicode)
-        self.failUnlessIsInstance(QTFormatDescriptionVideoEncodedPixelsSizeAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionAudioStreamBasicDescriptionAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionAudioMagicCookieAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionAudioChannelLayoutAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionVideoProductionApertureDisplaySizeAttribute, unicode)
+        self.assertIsInstance(QTFormatDescriptionVideoEncodedPixelsSizeAttribute, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTFormatDescription.isEqualToFormatDescription_)
+        self.assertResultIsBOOL(QTFormatDescription.isEqualToFormatDescription_)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_qtkitdefines.py

 
 class TestQTKitDefines (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(QTKIT_VERSION_7_0, 70000)
-        self.failUnlessEqual(QTKIT_VERSION_7_2, 70200)
+        self.assertEqual(QTKIT_VERSION_7_0, 70000)
+        self.assertEqual(QTKIT_VERSION_7_2, 70200)
 
-        self.failUnlessEqual(VideoMediaType, fourcc('vide'))
-        self.failUnlessEqual(SoundMediaType, fourcc('soun'))
-        self.failUnlessEqual(TextMediaType, fourcc('text'))
-        self.failUnlessEqual(BaseMediaType, fourcc('gnrc'))
-        self.failUnlessEqual(MPEGMediaType, fourcc('MPEG'))
-        self.failUnlessEqual(MusicMediaType, fourcc('musi'))
-        self.failUnlessEqual(TimeCodeMediaType, fourcc('tmcd'))
-        self.failUnlessEqual(SpriteMediaType, fourcc('sprt'))
-        self.failUnlessEqual(FlashMediaType, fourcc('flsh'))
-        self.failUnlessEqual(MovieMediaType, fourcc('moov'))
-        self.failUnlessEqual(TweenMediaType, fourcc('twen'))
-        self.failUnlessEqual(ThreeDeeMediaType, fourcc('qd3d'))
-        self.failUnlessEqual(SkinMediaType, fourcc('skin'))
-        self.failUnlessEqual(HandleDataHandlerSubType, fourcc('hndl'))
-        self.failUnlessEqual(PointerDataHandlerSubType, fourcc('ptr '))
-        self.failUnlessEqual(NullDataHandlerSubType, fourcc('null'))
-        self.failUnlessEqual(ResourceDataHandlerSubType, fourcc('rsrc'))
-        self.failUnlessEqual(URLDataHandlerSubType, fourcc('url '))
-        self.failUnlessEqual(AliasDataHandlerSubType, fourcc('alis'))
-        self.failUnlessEqual(WiredActionHandlerType, fourcc('wire'))
-        self.failUnlessEqual(kQTQuartzComposerMediaType, fourcc('qtz '))
-        self.failUnlessEqual(TimeCode64MediaType, fourcc('tc64'))
+        self.assertEqual(VideoMediaType, fourcc(b'vide'))
+        self.assertEqual(SoundMediaType, fourcc(b'soun'))
+        self.assertEqual(TextMediaType, fourcc(b'text'))
+        self.assertEqual(BaseMediaType, fourcc(b'gnrc'))
+        self.assertEqual(MPEGMediaType, fourcc(b'MPEG'))
+        self.assertEqual(MusicMediaType, fourcc(b'musi'))
+        self.assertEqual(TimeCodeMediaType, fourcc(b'tmcd'))
+        self.assertEqual(SpriteMediaType, fourcc(b'sprt'))
+        self.assertEqual(FlashMediaType, fourcc(b'flsh'))
+        self.assertEqual(MovieMediaType, fourcc(b'moov'))
+        self.assertEqual(TweenMediaType, fourcc(b'twen'))
+        self.assertEqual(ThreeDeeMediaType, fourcc(b'qd3d'))
+        self.assertEqual(SkinMediaType, fourcc(b'skin'))
+        self.assertEqual(HandleDataHandlerSubType, fourcc(b'hndl'))
+        self.assertEqual(PointerDataHandlerSubType, fourcc(b'ptr '))
+        self.assertEqual(NullDataHandlerSubType, fourcc(b'null'))
+        self.assertEqual(ResourceDataHandlerSubType, fourcc(b'rsrc'))
+        self.assertEqual(URLDataHandlerSubType, fourcc(b'url '))
+        self.assertEqual(AliasDataHandlerSubType, fourcc(b'alis'))
+        self.assertEqual(WiredActionHandlerType, fourcc(b'wire'))
+        self.assertEqual(kQTQuartzComposerMediaType, fourcc(b'qtz '))
+        self.assertEqual(TimeCode64MediaType, fourcc(b'tc64'))
 
-        self.failUnlessEqual(kQTFileTypeAIFF, fourcc('AIFF'))
-        self.failUnlessEqual(kQTFileTypeAIFC, fourcc('AIFC'))
-        self.failUnlessEqual(kQTFileTypeDVC, fourcc('dvc!'))
-        self.failUnlessEqual(kQTFileTypeMIDI, fourcc('Midi'))
-        self.failUnlessEqual(kQTFileTypePicture, fourcc('PICT'))
-        self.failUnlessEqual(kQTFileTypeMovie, fourcc('MooV'))
-        self.failUnlessEqual(kQTFileTypeText, fourcc('TEXT'))
-        self.failUnlessEqual(kQTFileTypeWave, fourcc('WAVE'))
-        self.failUnlessEqual(kQTFileTypeSystemSevenSound, fourcc('sfil'))
-        self.failUnlessEqual(kQTFileTypeMuLaw, fourcc('ULAW'))
-        self.failUnlessEqual(kQTFileTypeAVI, fourcc('VfW '))
-        self.failUnlessEqual(kQTFileTypeSoundDesignerII, fourcc('Sd2f'))
-        self.failUnlessEqual(kQTFileTypeAudioCDTrack, fourcc('trak'))
-        self.failUnlessEqual(kQTFileTypePICS, fourcc('PICS'))
-        self.failUnlessEqual(kQTFileTypeGIF, fourcc('GIFf'))
-        self.failUnlessEqual(kQTFileTypePNG, fourcc('PNGf'))
-        self.failUnlessEqual(kQTFileTypeTIFF, fourcc('TIFF'))
-        self.failUnlessEqual(kQTFileTypePhotoShop, fourcc('8BPS'))
-        self.failUnlessEqual(kQTFileTypeSGIImage, fourcc('.SGI'))
-        self.failUnlessEqual(kQTFileTypeBMP, fourcc('BMPf'))
-        self.failUnlessEqual(kQTFileTypeJPEG, fourcc('JPEG'))
-        self.failUnlessEqual(kQTFileTypeJFIF, fourcc('JPEG'))
-        self.failUnlessEqual(kQTFileTypeMacPaint, fourcc('PNTG'))
-        self.failUnlessEqual(kQTFileTypeTargaImage, fourcc('TPIC'))
-        self.failUnlessEqual(kQTFileTypeQuickDrawGXPicture, fourcc('qdgx'))
-        self.failUnlessEqual(kQTFileTypeQuickTimeImage, fourcc('qtif'))
-        self.failUnlessEqual(kQTFileType3DMF, fourcc('3DMF'))
-        self.failUnlessEqual(kQTFileTypeFLC, fourcc('FLC '))
-        self.failUnlessEqual(kQTFileTypeFlash, fourcc('SWFL'))
-        self.failUnlessEqual(kQTFileTypeFlashPix, fourcc('FPix'))
-        self.failUnlessEqual(kQTFileTypeMP4, fourcc('mpg4'))
-        self.failUnlessEqual(kQTFileTypePDF, fourcc('PDF '))
-        self.failUnlessEqual(kQTFileType3GPP, fourcc('3gpp'))
-        self.failUnlessEqual(kQTFileTypeAMR, fourcc('amr '))
-        self.failUnlessEqual(kQTFileTypeSDV, fourcc('sdv '))
-        self.failUnlessEqual(kQTFileType3GP2, fourcc('3gp2'))
-        self.failUnlessEqual(kQTFileTypeAMC, fourcc('amc '))
-        self.failUnlessEqual(kQTFileTypeJPEG2000, fourcc('jp2 '))
-        self.failUnlessEqual(codecLosslessQuality, 0x00000400)
-        self.failUnlessEqual(codecMaxQuality, 0x000003FF)
-        self.failUnlessEqual(codecMinQuality, 0x00000000)
-        self.failUnlessEqual(codecLowQuality, 0x00000100)
-        self.failUnlessEqual(codecNormalQuality, 0x00000200)
-        self.failUnlessEqual(codecHighQuality, 0x00000300)
-        self.failUnlessEqual(kRawCodecType, fourcc('raw '))
-        self.failUnlessEqual(kCinepakCodecType, fourcc('cvid'))
-        self.failUnlessEqual(kGraphicsCodecType, fourcc('smc '))
-        self.failUnlessEqual(kAnimationCodecType, fourcc('rle '))
-        self.failUnlessEqual(kVideoCodecType, fourcc('rpza'))
-        self.failUnlessEqual(kComponentVideoCodecType, fourcc('yuv2'))
-        self.failUnlessEqual(kJPEGCodecType, fourcc('jpeg'))
-        self.failUnlessEqual(kMotionJPEGACodecType, fourcc('mjpa'))
-        self.failUnlessEqual(kMotionJPEGBCodecType, fourcc('mjpb'))
-        self.failUnlessEqual(kSGICodecType, fourcc('.SGI'))
-        self.failUnlessEqual(kPlanarRGBCodecType, fourcc('8BPS'))
-        self.failUnlessEqual(kMacPaintCodecType, fourcc('PNTG'))
-        self.failUnlessEqual(kGIFCodecType, fourcc('gif '))
-        self.failUnlessEqual(kPhotoCDCodecType, fourcc('kpcd'))
-        self.failUnlessEqual(kQuickDrawGXCodecType, fourcc('qdgx'))
-        self.failUnlessEqual(kAVRJPEGCodecType, fourcc('avr '))
-        self.failUnlessEqual(kOpenDMLJPEGCodecType, fourcc('dmb1'))
-        self.failUnlessEqual(kBMPCodecType, fourcc('WRLE'))
-        self.failUnlessEqual(kWindowsRawCodecType, fourcc('WRAW'))
-        self.failUnlessEqual(kVectorCodecType, fourcc('path'))
-        self.failUnlessEqual(kQuickDrawCodecType, fourcc('qdrw'))
-        self.failUnlessEqual(kWaterRippleCodecType, fourcc('ripl'))
-        self.failUnlessEqual(kFireCodecType, fourcc('fire'))
-        self.failUnlessEqual(kCloudCodecType, fourcc('clou'))
-        self.failUnlessEqual(kH261CodecType, fourcc('h261'))
-        self.failUnlessEqual(kH263CodecType, fourcc('h263'))
-        self.failUnlessEqual(kDVCNTSCCodecType, fourcc('dvc '))
-        self.failUnlessEqual(kDVCPALCodecType, fourcc('dvcp'))
-        self.failUnlessEqual(kDVCProPALCodecType, fourcc('dvpp'))
-        self.failUnlessEqual(kDVCPro50NTSCCodecType, fourcc('dv5n'))
-        self.failUnlessEqual(kDVCPro50PALCodecType, fourcc('dv5p'))
-        self.failUnlessEqual(kDVCPro100NTSCCodecType, fourcc('dv1n'))
-        self.failUnlessEqual(kDVCPro100PALCodecType, fourcc('dv1p'))
-        self.failUnlessEqual(kDVCPROHD720pCodecType, fourcc('dvhp'))
-        self.failUnlessEqual(kDVCPROHD1080i60CodecType, fourcc('dvh6'))
-        self.failUnlessEqual(kDVCPROHD1080i50CodecType, fourcc('dvh5'))
-        self.failUnlessEqual(kBaseCodecType, fourcc('base'))
-        self.failUnlessEqual(kFLCCodecType, fourcc('flic'))
-        self.failUnlessEqual(kTargaCodecType, fourcc('tga '))
-        self.failUnlessEqual(kPNGCodecType, fourcc('png '))
-        self.failUnlessEqual(kTIFFCodecType, fourcc('tiff'))
-        self.failUnlessEqual(kComponentVideoSigned, fourcc('yuvu'))
-        self.failUnlessEqual(kComponentVideoUnsigned, fourcc('yuvs'))
-        self.failUnlessEqual(kCMYKCodecType, fourcc('cmyk'))
-        self.failUnlessEqual(kMicrosoftVideo1CodecType, fourcc('msvc'))
-        self.failUnlessEqual(kSorensonCodecType, fourcc('SVQ1'))
-        self.failUnlessEqual(kSorenson3CodecType, fourcc('SVQ3'))
-        self.failUnlessEqual(kIndeo4CodecType, fourcc('IV41'))
-        self.failUnlessEqual(kMPEG4VisualCodecType, fourcc('mp4v'))
-        self.failUnlessEqual(k64ARGBCodecType, fourcc('b64a'))
-        self.failUnlessEqual(k48RGBCodecType, fourcc('b48r'))
-        self.failUnlessEqual(k32AlphaGrayCodecType, fourcc('b32a'))
-        self.failUnlessEqual(k16GrayCodecType, fourcc('b16g'))
-        self.failUnlessEqual(kMpegYUV420CodecType, fourcc('myuv'))
-        self.failUnlessEqual(kYUV420CodecType, fourcc('y420'))
-        self.failUnlessEqual(kSorensonYUV9CodecType, fourcc('syv9'))
-        self.failUnlessEqual(k422YpCbCr8CodecType, fourcc('2vuy'))
-        self.failUnlessEqual(k444YpCbCr8CodecType, fourcc('v308'))
-        self.failUnlessEqual(k4444YpCbCrA8CodecType, fourcc('v408'))
-        self.failUnlessEqual(k422YpCbCr16CodecType, fourcc('v216'))
-        self.failUnlessEqual(k422YpCbCr10CodecType, fourcc('v210'))
-        self.failUnlessEqual(k444YpCbCr10CodecType, fourcc('v410'))
-        self.failUnlessEqual(k4444YpCbCrA8RCodecType, fourcc('r408'))
-        self.failUnlessEqual(kJPEG2000CodecType, fourcc('mjp2'))
-        self.failUnlessEqual(kPixletCodecType, fourcc('pxlt'))
-        self.failUnlessEqual(kH264CodecType, fourcc('avc1'))
-        self.failUnlessEqual(graphicsModeStraightAlpha, 256)
-        self.failUnlessEqual(graphicsModePreWhiteAlpha, 257)
-        self.failUnlessEqual(graphicsModePreBlackAlpha, 258)
-        self.failUnlessEqual(graphicsModeComposition, 259)
-        self.failUnlessEqual(graphicsModeStraightAlphaBlend, 260)
-        self.failUnlessEqual(graphicsModePreMulColorAlpha, 261)
-        self.failUnlessEqual(graphicsModePerComponentAlpha, 272)
+        self.assertEqual(kQTFileTypeAIFF, fourcc(b'AIFF'))
+        self.assertEqual(kQTFileTypeAIFC, fourcc(b'AIFC'))
+        self.assertEqual(kQTFileTypeDVC, fourcc(b'dvc!'))
+        self.assertEqual(kQTFileTypeMIDI, fourcc(b'Midi'))
+        self.assertEqual(kQTFileTypePicture, fourcc(b'PICT'))
+        self.assertEqual(kQTFileTypeMovie, fourcc(b'MooV'))
+        self.assertEqual(kQTFileTypeText, fourcc(b'TEXT'))
+        self.assertEqual(kQTFileTypeWave, fourcc(b'WAVE'))
+        self.assertEqual(kQTFileTypeSystemSevenSound, fourcc(b'sfil'))
+        self.assertEqual(kQTFileTypeMuLaw, fourcc(b'ULAW'))
+        self.assertEqual(kQTFileTypeAVI, fourcc(b'VfW '))
+        self.assertEqual(kQTFileTypeSoundDesignerII, fourcc(b'Sd2f'))
+        self.assertEqual(kQTFileTypeAudioCDTrack, fourcc(b'trak'))
+        self.assertEqual(kQTFileTypePICS, fourcc(b'PICS'))
+        self.assertEqual(kQTFileTypeGIF, fourcc(b'GIFf'))
+        self.assertEqual(kQTFileTypePNG, fourcc(b'PNGf'))
+        self.assertEqual(kQTFileTypeTIFF, fourcc(b'TIFF'))
+        self.assertEqual(kQTFileTypePhotoShop, fourcc(b'8BPS'))
+        self.assertEqual(kQTFileTypeSGIImage, fourcc(b'.SGI'))
+        self.assertEqual(kQTFileTypeBMP, fourcc(b'BMPf'))
+        self.assertEqual(kQTFileTypeJPEG, fourcc(b'JPEG'))
+        self.assertEqual(kQTFileTypeJFIF, fourcc(b'JPEG'))
+        self.assertEqual(kQTFileTypeMacPaint, fourcc(b'PNTG'))
+        self.assertEqual(kQTFileTypeTargaImage, fourcc(b'TPIC'))
+        self.assertEqual(kQTFileTypeQuickDrawGXPicture, fourcc(b'qdgx'))
+        self.assertEqual(kQTFileTypeQuickTimeImage, fourcc(b'qtif'))
+        self.assertEqual(kQTFileType3DMF, fourcc(b'3DMF'))
+        self.assertEqual(kQTFileTypeFLC, fourcc(b'FLC '))
+        self.assertEqual(kQTFileTypeFlash, fourcc(b'SWFL'))
+        self.assertEqual(kQTFileTypeFlashPix, fourcc(b'FPix'))
+        self.assertEqual(kQTFileTypeMP4, fourcc(b'mpg4'))
+        self.assertEqual(kQTFileTypePDF, fourcc(b'PDF '))
+        self.assertEqual(kQTFileType3GPP, fourcc(b'3gpp'))
+        self.assertEqual(kQTFileTypeAMR, fourcc(b'amr '))
+        self.assertEqual(kQTFileTypeSDV, fourcc(b'sdv '))
+        self.assertEqual(kQTFileType3GP2, fourcc(b'3gp2'))
+        self.assertEqual(kQTFileTypeAMC, fourcc(b'amc '))
+        self.assertEqual(kQTFileTypeJPEG2000, fourcc(b'jp2 '))
+        self.assertEqual(codecLosslessQuality, 0x00000400)
+        self.assertEqual(codecMaxQuality, 0x000003FF)
+        self.assertEqual(codecMinQuality, 0x00000000)
+        self.assertEqual(codecLowQuality, 0x00000100)
+        self.assertEqual(codecNormalQuality, 0x00000200)
+        self.assertEqual(codecHighQuality, 0x00000300)
+        self.assertEqual(kRawCodecType, fourcc(b'raw '))
+        self.assertEqual(kCinepakCodecType, fourcc(b'cvid'))
+        self.assertEqual(kGraphicsCodecType, fourcc(b'smc '))
+        self.assertEqual(kAnimationCodecType, fourcc(b'rle '))
+        self.assertEqual(kVideoCodecType, fourcc(b'rpza'))
+        self.assertEqual(kComponentVideoCodecType, fourcc(b'yuv2'))
+        self.assertEqual(kJPEGCodecType, fourcc(b'jpeg'))
+        self.assertEqual(kMotionJPEGACodecType, fourcc(b'mjpa'))
+        self.assertEqual(kMotionJPEGBCodecType, fourcc(b'mjpb'))
+        self.assertEqual(kSGICodecType, fourcc(b'.SGI'))
+        self.assertEqual(kPlanarRGBCodecType, fourcc(b'8BPS'))
+        self.assertEqual(kMacPaintCodecType, fourcc(b'PNTG'))
+        self.assertEqual(kGIFCodecType, fourcc(b'gif '))
+        self.assertEqual(kPhotoCDCodecType, fourcc(b'kpcd'))
+        self.assertEqual(kQuickDrawGXCodecType, fourcc(b'qdgx'))
+        self.assertEqual(kAVRJPEGCodecType, fourcc(b'avr '))
+        self.assertEqual(kOpenDMLJPEGCodecType, fourcc(b'dmb1'))
+        self.assertEqual(kBMPCodecType, fourcc(b'WRLE'))
+        self.assertEqual(kWindowsRawCodecType, fourcc(b'WRAW'))
+        self.assertEqual(kVectorCodecType, fourcc(b'path'))
+        self.assertEqual(kQuickDrawCodecType, fourcc(b'qdrw'))
+        self.assertEqual(kWaterRippleCodecType, fourcc(b'ripl'))
+        self.assertEqual(kFireCodecType, fourcc(b'fire'))
+        self.assertEqual(kCloudCodecType, fourcc(b'clou'))
+        self.assertEqual(kH261CodecType, fourcc(b'h261'))
+        self.assertEqual(kH263CodecType, fourcc(b'h263'))
+        self.assertEqual(kDVCNTSCCodecType, fourcc(b'dvc '))
+        self.assertEqual(kDVCPALCodecType, fourcc(b'dvcp'))
+        self.assertEqual(kDVCProPALCodecType, fourcc(b'dvpp'))
+        self.assertEqual(kDVCPro50NTSCCodecType, fourcc(b'dv5n'))
+        self.assertEqual(kDVCPro50PALCodecType, fourcc(b'dv5p'))
+        self.assertEqual(kDVCPro100NTSCCodecType, fourcc(b'dv1n'))
+        self.assertEqual(kDVCPro100PALCodecType, fourcc(b'dv1p'))
+        self.assertEqual(kDVCPROHD720pCodecType, fourcc(b'dvhp'))
+        self.assertEqual(kDVCPROHD1080i60CodecType, fourcc(b'dvh6'))
+        self.assertEqual(kDVCPROHD1080i50CodecType, fourcc(b'dvh5'))
+        self.assertEqual(kBaseCodecType, fourcc(b'base'))
+        self.assertEqual(kFLCCodecType, fourcc(b'flic'))
+        self.assertEqual(kTargaCodecType, fourcc(b'tga '))
+        self.assertEqual(kPNGCodecType, fourcc(b'png '))
+        self.assertEqual(kTIFFCodecType, fourcc(b'tiff'))
+        self.assertEqual(kComponentVideoSigned, fourcc(b'yuvu'))
+        self.assertEqual(kComponentVideoUnsigned, fourcc(b'yuvs'))
+        self.assertEqual(kCMYKCodecType, fourcc(b'cmyk'))
+        self.assertEqual(kMicrosoftVideo1CodecType, fourcc(b'msvc'))
+        self.assertEqual(kSorensonCodecType, fourcc(b'SVQ1'))
+        self.assertEqual(kSorenson3CodecType, fourcc(b'SVQ3'))
+        self.assertEqual(kIndeo4CodecType, fourcc(b'IV41'))
+        self.assertEqual(kMPEG4VisualCodecType, fourcc(b'mp4v'))
+        self.assertEqual(k64ARGBCodecType, fourcc(b'b64a'))
+        self.assertEqual(k48RGBCodecType, fourcc(b'b48r'))
+        self.assertEqual(k32AlphaGrayCodecType, fourcc(b'b32a'))
+        self.assertEqual(k16GrayCodecType, fourcc(b'b16g'))
+        self.assertEqual(kMpegYUV420CodecType, fourcc(b'myuv'))
+        self.assertEqual(kYUV420CodecType, fourcc(b'y420'))
+        self.assertEqual(kSorensonYUV9CodecType, fourcc(b'syv9'))
+        self.assertEqual(k422YpCbCr8CodecType, fourcc(b'2vuy'))
+        self.assertEqual(k444YpCbCr8CodecType, fourcc(b'v308'))
+        self.assertEqual(k4444YpCbCrA8CodecType, fourcc(b'v408'))
+        self.assertEqual(k422YpCbCr16CodecType, fourcc(b'v216'))
+        self.assertEqual(k422YpCbCr10CodecType, fourcc(b'v210'))
+        self.assertEqual(k444YpCbCr10CodecType, fourcc(b'v410'))
+        self.assertEqual(k4444YpCbCrA8RCodecType, fourcc(b'r408'))
+        self.assertEqual(kJPEG2000CodecType, fourcc(b'mjp2'))
+        self.assertEqual(kPixletCodecType, fourcc(b'pxlt'))
+        self.assertEqual(kH264CodecType, fourcc(b'avc1'))
+        self.assertEqual(graphicsModeStraightAlpha, 256)
+        self.assertEqual(graphicsModePreWhiteAlpha, 257)
+        self.assertEqual(graphicsModePreBlackAlpha, 258)
+        self.assertEqual(graphicsModeComposition, 259)
+        self.assertEqual(graphicsModeStraightAlphaBlend, 260)
+        self.assertEqual(graphicsModePreMulColorAlpha, 261)
+        self.assertEqual(graphicsModePerComponentAlpha, 272)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_qtmedia.py

 
 class TestQTMedia (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTMediaTypeVideo, unicode)
-        self.failUnlessIsInstance(QTMediaTypeSound, unicode)
-        self.failUnlessIsInstance(QTMediaTypeText, unicode)
-        self.failUnlessIsInstance(QTMediaTypeBase, unicode)
-        self.failUnlessIsInstance(QTMediaTypeMPEG, unicode)
-        self.failUnlessIsInstance(QTMediaTypeMusic, unicode)
-        self.failUnlessIsInstance(QTMediaTypeTimeCode, unicode)
-        self.failUnlessIsInstance(QTMediaTypeSprite, unicode)
-        self.failUnlessIsInstance(QTMediaTypeFlash, unicode)
-        self.failUnlessIsInstance(QTMediaTypeMovie, unicode)
-        self.failUnlessIsInstance(QTMediaTypeTween, unicode)
-        self.failUnlessIsInstance(QTMediaType3D, unicode)
-        self.failUnlessIsInstance(QTMediaTypeSkin, unicode)
-        self.failUnlessIsInstance(QTMediaTypeQTVR, unicode)
-        self.failUnlessIsInstance(QTMediaTypeHint, unicode)
-        self.failUnlessIsInstance(QTMediaTypeStream, unicode)
-        self.failUnlessIsInstance(QTMediaTypeMuxed, unicode)
-        self.failUnlessIsInstance(QTMediaTypeQuartzComposer, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicVisual, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicAudio, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicCanSendVideo, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicProvidesActions, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicNonLinear, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicCanStep, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicHasNoDuration, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicHasSkinData, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicProvidesKeyFocus, unicode)
-        self.failUnlessIsInstance(QTMediaCharacteristicHasVideoFrameRate, unicode)
-        self.failUnlessIsInstance(QTMediaCreationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaDurationAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaModificationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaSampleCountAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaQualityAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaTimeScaleAttribute, unicode)
-        self.failUnlessIsInstance(QTMediaTypeAttribute, unicode)
+        self.assertIsInstance(QTMediaTypeVideo, unicode)
+        self.assertIsInstance(QTMediaTypeSound, unicode)
+        self.assertIsInstance(QTMediaTypeText, unicode)
+        self.assertIsInstance(QTMediaTypeBase, unicode)
+        self.assertIsInstance(QTMediaTypeMPEG, unicode)
+        self.assertIsInstance(QTMediaTypeMusic, unicode)
+        self.assertIsInstance(QTMediaTypeTimeCode, unicode)
+        self.assertIsInstance(QTMediaTypeSprite, unicode)
+        self.assertIsInstance(QTMediaTypeFlash, unicode)
+        self.assertIsInstance(QTMediaTypeMovie, unicode)
+        self.assertIsInstance(QTMediaTypeTween, unicode)
+        self.assertIsInstance(QTMediaType3D, unicode)
+        self.assertIsInstance(QTMediaTypeSkin, unicode)
+        self.assertIsInstance(QTMediaTypeQTVR, unicode)
+        self.assertIsInstance(QTMediaTypeHint, unicode)
+        self.assertIsInstance(QTMediaTypeStream, unicode)
+        self.assertIsInstance(QTMediaTypeMuxed, unicode)
+        self.assertIsInstance(QTMediaTypeQuartzComposer, unicode)
+        self.assertIsInstance(QTMediaCharacteristicVisual, unicode)
+        self.assertIsInstance(QTMediaCharacteristicAudio, unicode)
+        self.assertIsInstance(QTMediaCharacteristicCanSendVideo, unicode)
+        self.assertIsInstance(QTMediaCharacteristicProvidesActions, unicode)
+        self.assertIsInstance(QTMediaCharacteristicNonLinear, unicode)
+        self.assertIsInstance(QTMediaCharacteristicCanStep, unicode)
+        self.assertIsInstance(QTMediaCharacteristicHasNoDuration, unicode)
+        self.assertIsInstance(QTMediaCharacteristicHasSkinData, unicode)
+        self.assertIsInstance(QTMediaCharacteristicProvidesKeyFocus, unicode)
+        self.assertIsInstance(QTMediaCharacteristicHasVideoFrameRate, unicode)
+        self.assertIsInstance(QTMediaCreationTimeAttribute, unicode)
+        self.assertIsInstance(QTMediaDurationAttribute, unicode)
+        self.assertIsInstance(QTMediaModificationTimeAttribute, unicode)
+        self.assertIsInstance(QTMediaSampleCountAttribute, unicode)
+        self.assertIsInstance(QTMediaQualityAttribute, unicode)
+        self.assertIsInstance(QTMediaTimeScaleAttribute, unicode)
+        self.assertIsInstance(QTMediaTypeAttribute, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTMedia.hasCharacteristic_)
+        self.assertResultIsBOOL(QTMedia.hasCharacteristic_)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qtmovie.py

 
 class TestQTMovie (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTMoviePasteboardType, unicode)
-        self.failUnlessIsInstance(QTMovieEditabilityDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieEditedNotification, unicode)
-        self.failUnlessIsInstance(QTMovieLoadStateDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieLoopModeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieMessageStringPostedNotification, unicode)
-        self.failUnlessIsInstance(QTMovieRateDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieSelectionDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieSizeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieStatusStringPostedNotification, unicode)
-        self.failUnlessIsInstance(QTMovieTimeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieVolumeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieDidEndNotification, unicode)
-        self.failUnlessIsInstance(QTMovieChapterDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieChapterListDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieEnterFullScreenRequestNotification, unicode)
-        self.failUnlessIsInstance(QTMovieExitFullScreenRequestNotification, unicode)
-        self.failUnlessIsInstance(QTMovieCloseWindowRequestNotification, unicode)
-        self.failUnlessIsInstance(QTMovieApertureModeDidChangeNotification, unicode)
-        self.failUnlessIsInstance(QTMovieMessageNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieRateDidChangeNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieStatusFlagsNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieStatusCodeNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieStatusStringNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieTargetIDNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieTargetNameNotificationParameter, unicode)
-        self.failUnlessIsInstance(QTMovieExport, unicode)
-        self.failUnlessIsInstance(QTMovieExportType, unicode)
-        self.failUnlessIsInstance(QTMovieFlatten, unicode)
-        self.failUnlessIsInstance(QTMovieExportSettings, unicode)
-        self.failUnlessIsInstance(QTMovieExportManufacturer, unicode)
-        self.failUnlessIsInstance(QTAddImageCodecType, unicode)
-        self.failUnlessIsInstance(QTAddImageCodecQuality, unicode)
-        self.failUnlessIsInstance(QTMovieDataReferenceAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePasteboardAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDataAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieFileOffsetAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieResolveDataRefsAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieAskUnresolvedDataRefsAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieOpenAsyncOKAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieApertureModeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieActiveSegmentAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieAutoAlternatesAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieCopyrightAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieCreationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieCurrentSizeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieCurrentTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDataSizeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDelegateAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDisplayNameAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDontInteractWithUserAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieDurationAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieEditableAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieFileNameAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieHasApertureModeDimensionsAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieHasAudioAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieHasDurationAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieHasVideoAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieIsActiveAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieIsInteractiveAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieIsLinearAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieIsSteppableAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieLoadStateAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieLoopsAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieLoopsBackAndForthAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieModificationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieMutedAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieNaturalSizeAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePlaysAllFramesAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePlaysSelectionOnlyAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePosterTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePreferredMutedAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePreferredRateAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePreferredVolumeAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePreviewModeAttribute, unicode)
-        self.failUnlessIsInstance(QTMoviePreviewRangeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieRateAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieSelectionAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieTimeScaleAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieURLAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieVolumeAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieRateChangesPreservePitchAttribute, unicode)
-        self.failUnlessIsInstance(QTMovieUneditableException, unicode)
+        self.assertIsInstance(QTMoviePasteboardType, unicode)
+        self.assertIsInstance(QTMovieEditabilityDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieEditedNotification, unicode)
+        self.assertIsInstance(QTMovieLoadStateDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieLoopModeDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieMessageStringPostedNotification, unicode)
+        self.assertIsInstance(QTMovieRateDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieSelectionDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieSizeDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieStatusStringPostedNotification, unicode)
+        self.assertIsInstance(QTMovieTimeDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieVolumeDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieDidEndNotification, unicode)
+        self.assertIsInstance(QTMovieChapterDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieChapterListDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieEnterFullScreenRequestNotification, unicode)
+        self.assertIsInstance(QTMovieExitFullScreenRequestNotification, unicode)
+        self.assertIsInstance(QTMovieCloseWindowRequestNotification, unicode)
+        self.assertIsInstance(QTMovieApertureModeDidChangeNotification, unicode)
+        self.assertIsInstance(QTMovieMessageNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieRateDidChangeNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieStatusFlagsNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieStatusCodeNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieStatusStringNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieTargetIDNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieTargetNameNotificationParameter, unicode)
+        self.assertIsInstance(QTMovieExport, unicode)
+        self.assertIsInstance(QTMovieExportType, unicode)
+        self.assertIsInstance(QTMovieFlatten, unicode)
+        self.assertIsInstance(QTMovieExportSettings, unicode)
+        self.assertIsInstance(QTMovieExportManufacturer, unicode)
+        self.assertIsInstance(QTAddImageCodecType, unicode)
+        self.assertIsInstance(QTAddImageCodecQuality, unicode)
+        self.assertIsInstance(QTMovieDataReferenceAttribute, unicode)
+        self.assertIsInstance(QTMoviePasteboardAttribute, unicode)
+        self.assertIsInstance(QTMovieDataAttribute, unicode)
+        self.assertIsInstance(QTMovieFileOffsetAttribute, unicode)
+        self.assertIsInstance(QTMovieResolveDataRefsAttribute, unicode)
+        self.assertIsInstance(QTMovieAskUnresolvedDataRefsAttribute, unicode)
+        self.assertIsInstance(QTMovieOpenAsyncOKAttribute, unicode)
+        self.assertIsInstance(QTMovieApertureModeAttribute, unicode)
+        self.assertIsInstance(QTMovieActiveSegmentAttribute, unicode)
+        self.assertIsInstance(QTMovieAutoAlternatesAttribute, unicode)
+        self.assertIsInstance(QTMovieCopyrightAttribute, unicode)
+        self.assertIsInstance(QTMovieCreationTimeAttribute, unicode)
+        self.assertIsInstance(QTMovieCurrentSizeAttribute, unicode)
+        self.assertIsInstance(QTMovieCurrentTimeAttribute, unicode)
+        self.assertIsInstance(QTMovieDataSizeAttribute, unicode)
+        self.assertIsInstance(QTMovieDelegateAttribute, unicode)
+        self.assertIsInstance(QTMovieDisplayNameAttribute, unicode)
+        self.assertIsInstance(QTMovieDontInteractWithUserAttribute, unicode)
+        self.assertIsInstance(QTMovieDurationAttribute, unicode)
+        self.assertIsInstance(QTMovieEditableAttribute, unicode)
+        self.assertIsInstance(QTMovieFileNameAttribute, unicode)
+        self.assertIsInstance(QTMovieHasApertureModeDimensionsAttribute, unicode)
+        self.assertIsInstance(QTMovieHasAudioAttribute, unicode)
+        self.assertIsInstance(QTMovieHasDurationAttribute, unicode)
+        self.assertIsInstance(QTMovieHasVideoAttribute, unicode)
+        self.assertIsInstance(QTMovieIsActiveAttribute, unicode)
+        self.assertIsInstance(QTMovieIsInteractiveAttribute, unicode)
+        self.assertIsInstance(QTMovieIsLinearAttribute, unicode)
+        self.assertIsInstance(QTMovieIsSteppableAttribute, unicode)
+        self.assertIsInstance(QTMovieLoadStateAttribute, unicode)
+        self.assertIsInstance(QTMovieLoopsAttribute, unicode)
+        self.assertIsInstance(QTMovieLoopsBackAndForthAttribute, unicode)
+        self.assertIsInstance(QTMovieModificationTimeAttribute, unicode)
+        self.assertIsInstance(QTMovieMutedAttribute, unicode)
+        self.assertIsInstance(QTMovieNaturalSizeAttribute, unicode)
+        self.assertIsInstance(QTMoviePlaysAllFramesAttribute, unicode)
+        self.assertIsInstance(QTMoviePlaysSelectionOnlyAttribute, unicode)
+        self.assertIsInstance(QTMoviePosterTimeAttribute, unicode)
+        self.assertIsInstance(QTMoviePreferredMutedAttribute, unicode)
+        self.assertIsInstance(QTMoviePreferredRateAttribute, unicode)
+        self.assertIsInstance(QTMoviePreferredVolumeAttribute, unicode)
+        self.assertIsInstance(QTMoviePreviewModeAttribute, unicode)
+        self.assertIsInstance(QTMoviePreviewRangeAttribute, unicode)
+        self.assertIsInstance(QTMovieRateAttribute, unicode)
+        self.assertIsInstance(QTMovieSelectionAttribute, unicode)
+        self.assertIsInstance(QTMovieTimeScaleAttribute, unicode)
+        self.assertIsInstance(QTMovieURLAttribute, unicode)
+        self.assertIsInstance(QTMovieVolumeAttribute, unicode)
+        self.assertIsInstance(QTMovieRateChangesPreservePitchAttribute, unicode)
+        self.assertIsInstance(QTMovieUneditableException, unicode)
 
-        self.failUnlessEqual(QTIncludeStillImageTypes, 1 << 0)
-        self.failUnlessEqual(QTIncludeTranslatableTypes, 1 << 1)
-        self.failUnlessEqual(QTIncludeAggressiveTypes, 1 << 2)
-        self.failUnlessEqual(QTIncludeDynamicTypes, 1 << 3)
-        self.failUnlessEqual(QTIncludeCommonTypes, 0)
-        self.failUnlessEqual(QTIncludeAllTypes, 0xffff)
-        self.failUnlessEqual(QTMovieOperationBeginPhase, 0)
-        self.failUnlessEqual(QTMovieOperationUpdatePercentPhase, 1)
-        self.failUnlessEqual(QTMovieOperationEndPhase, 2)
+        self.assertEqual(QTIncludeStillImageTypes, 1 << 0)
+        self.assertEqual(QTIncludeTranslatableTypes, 1 << 1)
+        self.assertEqual(QTIncludeAggressiveTypes, 1 << 2)
+        self.assertEqual(QTIncludeDynamicTypes, 1 << 3)
+        self.assertEqual(QTIncludeCommonTypes, 0)
+        self.assertEqual(QTIncludeAllTypes, 0xffff)
+        self.assertEqual(QTMovieOperationBeginPhase, 0)
+        self.assertEqual(QTMovieOperationUpdatePercentPhase, 1)
+        self.assertEqual(QTMovieOperationEndPhase, 2)
 
-        self.failUnlessEqual(QTMovieLoadStateError, -1)
-        self.failUnlessEqual(QTMovieLoadStateLoading, 1000)
-        self.failUnlessEqual(QTMovieLoadStateLoaded, 2000)
-        self.failUnlessEqual(QTMovieLoadStatePlayable, 10000)
-        self.failUnlessEqual(QTMovieLoadStatePlaythroughOK, 20000)
-        self.failUnlessEqual(QTMovieLoadStateComplete, 100000)
+        self.assertEqual(QTMovieLoadStateError, -1)
+        self.assertEqual(QTMovieLoadStateLoading, 1000)
+        self.assertEqual(QTMovieLoadStateLoaded, 2000)
+        self.assertEqual(QTMovieLoadStatePlayable, 10000)
+        self.assertEqual(QTMovieLoadStatePlaythroughOK, 20000)
+        self.assertEqual(QTMovieLoadStateComplete, 100000)
 
 
 
     @min_os_level('10.5')
     def testConstants10_5(self):
-        self.failUnlessIsInstance(QTMovieApertureModeClassic, unicode)
-        self.failUnlessIsInstance(QTMovieApertureModeClean, unicode)
-        self.failUnlessIsInstance(QTMovieApertureModeProduction, unicode)
-        self.failUnlessIsInstance(QTMovieApertureModeEncodedPixels, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageSize, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageType, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageTypeNSImage, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageTypeCGImageRef, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageTypeCIImage, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageTypeCVPixelBufferRef, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageTypeCVOpenGLTextureRef, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageOpenGLContext, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImagePixelFormat, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageRepresentationsType, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageDeinterlaceFields, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageHighQuality, unicode)
-        self.failUnlessIsInstance(QTMovieFrameImageSingleField, unicode)
-        self.failUnlessIsInstance(QTMovieChapterName, unicode)
-        self.failUnlessIsInstance(QTMovieChapterStartTime, unicode)
-        self.failUnlessIsInstance(QTMovieChapterTargetTrackAttribute, unicode)
+        self.assertIsInstance(QTMovieApertureModeClassic, unicode)
+        self.assertIsInstance(QTMovieApertureModeClean, unicode)
+        self.assertIsInstance(QTMovieApertureModeProduction, unicode)
+        self.assertIsInstance(QTMovieApertureModeEncodedPixels, unicode)
+        self.assertIsInstance(QTMovieFrameImageSize, unicode)
+        self.assertIsInstance(QTMovieFrameImageType, unicode)
+        self.assertIsInstance(QTMovieFrameImageTypeNSImage, unicode)
+        self.assertIsInstance(QTMovieFrameImageTypeCGImageRef, unicode)
+        self.assertIsInstance(QTMovieFrameImageTypeCIImage, unicode)
+        self.assertIsInstance(QTMovieFrameImageTypeCVPixelBufferRef, unicode)
+        self.assertIsInstance(QTMovieFrameImageTypeCVOpenGLTextureRef, unicode)
+        self.assertIsInstance(QTMovieFrameImageOpenGLContext, unicode)
+        self.assertIsInstance(QTMovieFrameImagePixelFormat, unicode)
+        self.assertIsInstance(QTMovieFrameImageRepresentationsType, unicode)
+        self.assertIsInstance(QTMovieFrameImageDeinterlaceFields, unicode)
+        self.assertIsInstance(QTMovieFrameImageHighQuality, unicode)
+        self.assertIsInstance(QTMovieFrameImageSingleField, unicode)
+        self.assertIsInstance(QTMovieChapterName, unicode)
+        self.assertIsInstance(QTMovieChapterStartTime, unicode)
+        self.assertIsInstance(QTMovieChapterTargetTrackAttribute, unicode)
 
     def testInformalProtocols(self):
-        self.failUnlessIsInstance(protocols.QTMovieDelegate, objc.informal_protocol)
-        self.failUnlessResultIsBOOL(TestQTMovieHelper.movie_linkToURL_)
-        self.failUnlessResultIsBOOL(TestQTMovieHelper.movieShouldLoadData_)
-        self.failUnlessResultIsBOOL(TestQTMovieHelper.movieShouldTask_)
-        self.failUnlessResultIsBOOL(TestQTMovieHelper.movie_shouldContinueOperation_withPhase_atPercent_withAttributes_)
-        self.failUnlessArgHasType(TestQTMovieHelper.movie_shouldContinueOperation_withPhase_atPercent_withAttributes_, 2, objc._C_INT)
+        self.assertIsInstance(protocols.QTMovieDelegate, objc.informal_protocol)
+        self.assertResultIsBOOL(TestQTMovieHelper.movie_linkToURL_)
+        self.assertResultIsBOOL(TestQTMovieHelper.movieShouldLoadData_)
+        self.assertResultIsBOOL(TestQTMovieHelper.movieShouldTask_)
+        self.assertResultIsBOOL(TestQTMovieHelper.movie_shouldContinueOperation_withPhase_atPercent_withAttributes_)
+        self.assertArgHasType(TestQTMovieHelper.movie_shouldContinueOperation_withPhase_atPercent_withAttributes_, 2, objc._C_INT)
 
     @onlyOn32Bit
     def testMethods32(self):
-        self.failUnlessArgIsBOOL(QTMovie.movieWithQuickTimeMovie_disposeWhenDone_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithQuickTimeMovie_disposeWhenDone_error_, 2)
-        self.failUnlessArgIsBOOL(QTMovie.initWithQuickTimeMovie_disposeWhenDone_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithQuickTimeMovie_disposeWhenDone_error_, 2)
+        self.assertArgIsBOOL(QTMovie.movieWithQuickTimeMovie_disposeWhenDone_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithQuickTimeMovie_disposeWhenDone_error_, 2)
+        self.assertArgIsBOOL(QTMovie.initWithQuickTimeMovie_disposeWhenDone_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithQuickTimeMovie_disposeWhenDone_error_, 2)
 
     @onlyOn32Bit
     def testCarbonQuickTimeIntegration(self):
 
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTMovie.canInitWithPasteboard_)
-        self.failUnlessResultIsBOOL(QTMovie.canInitWithFile_)
-        self.failUnlessResultIsBOOL(QTMovie.canInitWithURL_)
-        self.failUnlessResultIsBOOL(QTMovie.canInitWithDataReference_)
-        self.failUnlessResultIsBOOL(QTMovie.muted)
+        self.assertResultIsBOOL(QTMovie.canInitWithPasteboard_)
+        self.assertResultIsBOOL(QTMovie.canInitWithFile_)
+        self.assertResultIsBOOL(QTMovie.canInitWithURL_)
+        self.assertResultIsBOOL(QTMovie.canInitWithDataReference_)
+        self.assertResultIsBOOL(QTMovie.muted)
 
 
-        self.failUnlessArgIsOut(QTMovie.movieWithFile_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithURL_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithDataReference_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithPasteboard_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithData_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithAttributes_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieNamed_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithFile_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithURL_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithDataReference_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithPasteboard_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initWithData_error_, 1)
-        self.failUnlessArgHasType(QTMovie.initWithMovie_timeRange_error_, 1, '{?={?=qll}{?=qll}}')
-        self.failUnlessArgIsOut(QTMovie.initWithMovie_timeRange_error_, 2)
-        self.failUnlessArgIsOut(QTMovie.initWithAttributes_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.movieWithTimeRange_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initToWritableFile_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initToWritableData_error_, 1)
-        self.failUnlessArgIsOut(QTMovie.initToWritableDataReference_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithFile_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithURL_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithDataReference_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithPasteboard_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithData_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithAttributes_error_, 1)
+        self.assertArgIsOut(QTMovie.movieNamed_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithFile_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithURL_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithDataReference_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithPasteboard_error_, 1)
+        self.assertArgIsOut(QTMovie.initWithData_error_, 1)
+        self.assertArgHasType(QTMovie.initWithMovie_timeRange_error_, 1, b'{?={?=qll}{?=qll}}')
+        self.assertArgIsOut(QTMovie.initWithMovie_timeRange_error_, 2)
+        self.assertArgIsOut(QTMovie.initWithAttributes_error_, 1)
+        self.assertArgIsOut(QTMovie.movieWithTimeRange_error_, 1)
+        self.assertArgIsOut(QTMovie.initToWritableFile_error_, 1)
+        self.assertArgIsOut(QTMovie.initToWritableData_error_, 1)
+        self.assertArgIsOut(QTMovie.initToWritableDataReference_error_, 1)
 
-        self.failUnlessArgIsOut(QTMovie.frameImageAtTime_withAttributes_error_, 2)
-        self.failUnlessResultIsBOOL(QTMovie.writeToFile_withAttributes_)
-        self.failUnlessResultIsBOOL(QTMovie.writeToFile_withAttributes_error_)
-        self.failUnlessArgIsOut(QTMovie.writeToFile_withAttributes_error_, 2)
-        self.failUnlessResultIsBOOL(QTMovie.canUpdateMovieFile)
-        self.failUnlessResultIsBOOL(QTMovie.updateMovieFile)
-        self.failUnlessArgIsBOOL(QTMovie.setMuted_, 0)
-        self.failUnlessResultIsBOOL(QTMovie.attachToCurrentThread)
-        self.failUnlessResultIsBOOL(QTMovie.detachFromCurrentThread)
-        self.failUnlessArgIsBOOL(QTMovie.setIdling_, 0)
-        self.failUnlessResultIsBOOL(QTMovie.isIdling)
-        self.failUnlessResultIsBOOL(QTMovie.hasChapters)
-        self.failUnlessResultIsBOOL(QTMovie.removeChapters)
+        self.assertArgIsOut(QTMovie.frameImageAtTime_withAttributes_error_, 2)
+        self.assertResultIsBOOL(QTMovie.writeToFile_withAttributes_)
+        self.assertResultIsBOOL(QTMovie.writeToFile_withAttributes_error_)
+        self.assertArgIsOut(QTMovie.writeToFile_withAttributes_error_, 2)
+        self.assertResultIsBOOL(QTMovie.canUpdateMovieFile)
+        self.assertResultIsBOOL(QTMovie.updateMovieFile)
+        self.assertArgIsBOOL(QTMovie.setMuted_, 0)
+        self.assertResultIsBOOL(QTMovie.attachToCurrentThread)
+        self.assertResultIsBOOL(QTMovie.detachFromCurrentThread)
+        self.assertArgIsBOOL(QTMovie.setIdling_, 0)
+        self.assertResultIsBOOL(QTMovie.isIdling)
+        self.assertResultIsBOOL(QTMovie.hasChapters)
+        self.assertResultIsBOOL(QTMovie.removeChapters)
 
 
 

pyobjc-framework-QTKit/PyObjCTest/test_qtsamplebuffer.py

 
 class TestQTSampleBuffer (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTSampleBufferSMPTETimeAttribute, unicode)
-        self.failUnlessIsInstance(QTSampleBufferDateRecordedAttribute, unicode)
-        self.failUnlessIsInstance(QTSampleBufferHostTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTSampleBufferSceneChangeTypeAttribute, unicode)
-        self.failUnlessIsInstance(QTSampleBufferExplicitSceneChange, unicode)
-        self.failUnlessIsInstance(QTSampleBufferTimeStampDiscontinuitySceneChange, unicode)
+        self.assertIsInstance(QTSampleBufferSMPTETimeAttribute, unicode)
+        self.assertIsInstance(QTSampleBufferDateRecordedAttribute, unicode)
+        self.assertIsInstance(QTSampleBufferHostTimeAttribute, unicode)
+        self.assertIsInstance(QTSampleBufferSceneChangeTypeAttribute, unicode)
+        self.assertIsInstance(QTSampleBufferExplicitSceneChange, unicode)
+        self.assertIsInstance(QTSampleBufferTimeStampDiscontinuitySceneChange, unicode)
 
-        self.failUnlessEqual(QTSampleBufferAudioBufferListOptionAssure16ByteAlignment, 1)
+        self.assertEqual(QTSampleBufferAudioBufferListOptionAssure16ByteAlignment, 1)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTSampleBuffer.getAudioStreamPacketDescriptions_inRange_)
+        self.assertResultIsBOOL(QTSampleBuffer.getAudioStreamPacketDescriptions_inRange_)
 
 
 

pyobjc-framework-QTKit/PyObjCTest/test_qttime.py

 
 class TestQTTime (TestCase):
     def testConstants(self):
-        self.failUnlessEqual(kQTTimeIsIndefinite, 1)
-        self.failUnlessIsInstance(QTZeroTime, QTTime)
-        self.failUnlessIsInstance(QTIndefiniteTime, QTTime)
+        self.assertEqual(kQTTimeIsIndefinite, 1)
+        self.assertIsInstance(QTZeroTime, QTTime)
+        self.assertIsInstance(QTIndefiniteTime, QTTime)
 
     def testStruct(self):
         v = QTTime()
-        self.failUnless(hasattr(v, 'timeValue'))
-        self.failUnless(hasattr(v, 'timeScale'))
-        self.failUnless(hasattr(v, 'flags'))
+        self.assertHasAttr(v, 'timeValue')
+        self.assertHasAttr(v, 'timeScale')
+        self.assertHasAttr(v, 'flags')
 
-        self.failIf(QTTime.__typestr__.startswith('{?'))
+        self.assertFalse(QTTime.__typestr__.startswith(b'{?'))
 
     def testFunctions(self):
         #v = QTMakeTimeWithTimeRecord((1, 0, 0))
-        #self.failUnlessIsInstance(v, QTTime)
+        #self.assertIsInstance(v, QTTime)
 
         v = QTMakeTimeWithTimeInterval(1500.0)
-        self.failUnlessIsInstance(v, QTTime)
+        self.assertIsInstance(v, QTTime)
 
-        #self.failUnlessResultIsBOOL(QTGetTimeRecord)
+        #self.assertResultIsBOOL(QTGetTimeRecord)
         #v, o = QTGetTimeRecord(v, None)
-        #self.failUnless(v is True)
+        #self.assertTrue(v is True)
 
         v, o = QTGetTimeInterval(QTMakeTimeWithTimeInterval(1500.0), None)
-        self.failUnless(v is True)
-        self.failUnlessEqual(o, 1500.0)
+        self.assertTrue(v is True)
+        self.assertEqual(o, 1500.0)
 
         v = QTTimeCompare(QTMakeTimeWithTimeInterval(1500.0), QTMakeTimeWithTimeInterval(1500.0))
-        self.failUnlessIsInstance(v, (int, long))
+        self.assertIsInstance(v, (int, long))
 
         v = QTMakeTimeWithTimeInterval(1500.0)
         w = QTMakeTimeWithTimeInterval(10.0)
 
         o = QTTimeIncrement(v, w)
-        self.failUnlessIsInstance(o, QTTime)
+        self.assertIsInstance(o, QTTime)
         o = QTTimeDecrement(v, w)
-        self.failUnlessIsInstance(o, QTTime)
+        self.assertIsInstance(o, QTTime)
 
         o = QTStringFromTime(v)
-        self.failUnlessIsInstance(o, unicode)
+        self.assertIsInstance(o, unicode)
 
         o = QTTimeFromString(o)
-        self.failUnlessIsInstance(o, QTTime)
+        self.assertIsInstance(o, QTTime)
 
-        self.failUnlessResultIsBOOL(QTTimeIsIndefinite)
+        self.assertResultIsBOOL(QTTimeIsIndefinite)
         o = QTTimeIsIndefinite(v)
-        self.failUnless(o is False)
+        self.assertTrue(o is False)
         o = QTTimeIsIndefinite(QTIndefiniteTime)
-        self.failUnless(o is True)
+        self.assertTrue(o is True)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/PyObjCTest/test_qttimerange.py

 class TestQTTimeRange (TestCase):
     def testStructs(self):
         v = QTTimeRange()
-        self.failUnless(hasattr(v, 'time'))
-        self.failUnless(hasattr(v, 'duration'))
+        self.assertHasAttr(v, 'time')
+        self.assertHasAttr(v, 'duration')
 
     def testFunctions(self):
         v = QTMakeTimeWithTimeInterval(1500.0)
         w = QTMakeTimeWithTimeInterval(10.0)
 
         rng = QTMakeTimeRange(v, w)
-        self.failUnlessIsInstance(rng, QTTimeRange)
+        self.assertIsInstance(rng, QTTimeRange)
 
         rng2 = QTMakeTimeRange(w, v)
-        self.failUnlessIsInstance(rng2, QTTimeRange)
+        self.assertIsInstance(rng2, QTTimeRange)
 
-        self.failUnlessResultIsBOOL(QTTimeInTimeRange)
-        self.failUnlessResultIsBOOL(QTEqualTimeRanges)
+        self.assertResultIsBOOL(QTTimeInTimeRange)
+        self.assertResultIsBOOL(QTEqualTimeRanges)
 
         o = QTTimeInTimeRange(v, rng)
-        self.failUnless(o is True)
+        self.assertTrue(o is True)
         o = QTTimeInTimeRange(w, rng)
-        self.failUnless(o is False)
+        self.assertTrue(o is False)
 
         o = QTEqualTimeRanges(rng, rng)
-        self.failUnless(o is True)
+        self.assertTrue(o is True)
 
         o = QTTimeRangeEnd(rng)
-        self.failUnlessIsInstance(o, QTTime)
+        self.assertIsInstance(o, QTTime)
 
         o = QTUnionTimeRange(rng, rng2)
-        self.failUnlessIsInstance(o, QTTimeRange)
+        self.assertIsInstance(o, QTTimeRange)
 
         o = QTIntersectionTimeRange(rng, rng2)
-        self.failUnlessIsInstance(o, QTTimeRange)
+        self.assertIsInstance(o, QTTimeRange)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qttrack.py

 
 class TestQTTrack (TestCase):
     def testConstants(self):
-        self.failUnlessIsInstance(QTTrackBoundsAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackCreationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackDimensionsAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackDisplayNameAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackEnabledAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackFormatSummaryAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackIsChapterTrackAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackHasApertureModeDimensionsAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackIDAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackLayerAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackMediaTypeAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackModificationTimeAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackRangeAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackTimeScaleAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackUsageInMovieAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackUsageInPosterAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackUsageInPreviewAttribute, unicode)
-        self.failUnlessIsInstance(QTTrackVolumeAttribute, unicode)
+        self.assertIsInstance(QTTrackBoundsAttribute, unicode)
+        self.assertIsInstance(QTTrackCreationTimeAttribute, unicode)
+        self.assertIsInstance(QTTrackDimensionsAttribute, unicode)
+        self.assertIsInstance(QTTrackDisplayNameAttribute, unicode)
+        self.assertIsInstance(QTTrackEnabledAttribute, unicode)
+        self.assertIsInstance(QTTrackFormatSummaryAttribute, unicode)
+        self.assertIsInstance(QTTrackIsChapterTrackAttribute, unicode)
+        self.assertIsInstance(QTTrackHasApertureModeDimensionsAttribute, unicode)
+        self.assertIsInstance(QTTrackIDAttribute, unicode)
+        self.assertIsInstance(QTTrackLayerAttribute, unicode)
+        self.assertIsInstance(QTTrackMediaTypeAttribute, unicode)
+        self.assertIsInstance(QTTrackModificationTimeAttribute, unicode)
+        self.assertIsInstance(QTTrackRangeAttribute, unicode)
+        self.assertIsInstance(QTTrackTimeScaleAttribute, unicode)
+        self.assertIsInstance(QTTrackUsageInMovieAttribute, unicode)
+        self.assertIsInstance(QTTrackUsageInPosterAttribute, unicode)
+        self.assertIsInstance(QTTrackUsageInPreviewAttribute, unicode)
+        self.assertIsInstance(QTTrackVolumeAttribute, unicode)
 
     def testMethods(self):
-        self.failUnlessResultIsBOOL(QTTrack.isEnabled)
-        self.failUnlessArgIsBOOL(QTTrack.setEnabled_, 0)
+        self.assertResultIsBOOL(QTTrack.isEnabled)
+        self.assertArgIsBOOL(QTTrack.setEnabled_, 0)
 
 if __name__ == "__main__":
     main()

pyobjc-framework-QTKit/PyObjCTest/test_qtutilities.py

 class TestQTUtilities (TestCase):
     def testFunctions(self):
         v = QTStringForOSType(15490)
-        self.failUnlessIsInstance(v, unicode)
+        self.assertIsInstance(v, unicode)
 
         w = QTOSTypeForString(v)
-        self.failUnlessIsInstance(w, (int, long))
-        self.failUnlessEqual(w, 15490)
+        self.assertIsInstance(w, (int, long))
+        self.assertEqual(w, 15490)
 
 
 if __name__ == "__main__":

pyobjc-framework-QTKit/pyobjc_setup.py

 
 __all__ = ('setup', 'Extension', 'Command')
 
-import ez_setup
-ez_setup.use_setuptools()
+import sys
+if sys.version_info[:2] < (3, 0):
+    import ez_setup
+    ez_setup.use_setuptools()
+
+    from setuptools.command.test import test as oc_test
+    from setuptools.command.build_py import build_py as oc_build_py
+
+    extra_args = {}
+
+
+else:
+    import distribute_setup
+    distribute_setup.use_setuptools()
+
+    from setuptools.command import test
+    from setuptools.command import build_py
+
+    from distutils import log
+
+    extra_args=dict(
+        use_2to3 = True,
+    )
+
+
+    class oc_build_py (build_py.build_py):
+        def build_packages(self):
+            log.info("Overriding build_packages to copy PyObjCTest")
+            p = self.packages
+            self.packages = list(self.packages) + ['PyObjCTest']
+            try:
+                build_py.build_py.build_packages(self)
+            finally:
+                self.packages = p
+
+
+
+    class oc_test (test.test):
+        def run_tests(self):
+            import sys, os
+
+            rootdir =  os.path.dirname(os.path.abspath(__file__))
+            if rootdir in sys.path:
+                sys.path.remove(rootdir)
+
+            import PyObjCTest
+            import unittest
+            from pkg_resources import EntryPoint
+            loader_ep = EntryPoint.parse("x="+self.test_loader)
+            loader_class = loader_ep.load(require=False)
+
+            unittest.main(None, None, [unittest.__file__]+self.test_args, testLoader=loader_class())
+
+
 
 from setuptools import setup as _setup, Extension as _Extension, Command
 from distutils.errors import DistutilsPlatformError
 from distutils.command import build, install, install_lib
 from setuptools.command import develop, test, build_ext
+import pkg_resources
+import shutil
+import os
 import plistlib
 import sys
 import __main__
 
 class pyobjc_build_ext (build_ext.build_ext):
     def run(self):
+
+        # Ensure that the PyObjC header files are available
+        # in 2.3 and later the headers are in the egg,
+        # before that we ship a copy.
+        dist, = pkg_resources.require('pyobjc-core')
+
+        include_root = os.path.join(self.build_temp, 'pyobjc-include')
+        if os.path.exists(include_root):
+            shutil.rmtree(include_root)
+
+        os.makedirs(include_root)
+        if dist.has_metadata('include'):
+            for fn in dist.metadata_listdir('include'):
+                data = dist.get_metadata('include/%s'%(fn,))
+                open(os.path.join(include_root, fn), 'w').write(data)
+
+        else:
+            data = gPyObjCAPI_H
+            open(os.path.join(include_rot, 'pyobjc-api.h'), 'w').write(data)
+
+        for e in self.extensions:
+            if include_root not in e.include_dirs:
+                e.include_dirs.append(include_root)
+
+        # Run the actual build
         build_ext.build_ext.run(self)
+
+        # Then tweak the copy_extensions bit to ensure PyObjCTest gets
+        # copied to the right place.
         extensions = self.extensions
         self.extensions = [
             e for e in extensions if e.name.startswith('PyObjCTest') ]
         cmdclass=None,
         **kwds):
 
+
+    k = kwds.copy()
+    k.update(extra_args)
+
     os_level = get_os_level()
     os_compatible = True
     if sys.platform != 'darwin':
             return subcommand
 
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = create_command_subclass(test.test)
+        cmdclass['test'] = create_command_subclass(oc_test)
         cmdclass['install'] = create_command_subclass(install.install)
         cmdclass['develop'] = create_command_subclass(develop.develop)
+        cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:
         cmdclass['build_ext'] = pyobjc_build_ext
         cmdclass['install_lib'] = pyobjc_install_lib
+        cmdclass['test'] = oc_test
+        cmdclass['build_py'] = oc_build_py
+
+
 
     _setup(
         cmdclass=cmdclass, 
         package_data = { '': ['*.bridgesupport'] },
         test_suite='PyObjCTest',
         zip_safe = True,
-        **kwds
+        **k
     ) 
+
+
+gPyObjCAPI_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;
+