Log message for revision 91557: Remove test which wasn't testing anything, but broke anyway.
Changed: U Zope/trunk/lib/python/OFS/CopySupport.py U Zope/trunk/lib/python/OFS/tests/testCopySupport.py U Zope/trunk/lib/python/ZServer/tests/test_clockserver.py -=- Modified: Zope/trunk/lib/python/OFS/CopySupport.py =================================================================== --- Zope/trunk/lib/python/OFS/CopySupport.py 2008-09-27 11:31:03 UTC (rev 91556) +++ Zope/trunk/lib/python/OFS/CopySupport.py 2008-09-27 11:35:11 UTC (rev 91557) @@ -48,7 +48,8 @@ from OFS.interfaces import ICopySource -CopyError='Copy Error' +class CopyError(Exception): + pass copy_re = re.compile('^copy([0-9]*)_of_(.*)') @@ -99,10 +100,11 @@ ob=self._getOb(id) if ob.wl_isLocked(): - raise ResourceLockedError, 'Object "%s" is locked via WebDAV' % ob.getId() + raise ResourceLockedError('Object "%s" is locked via WebDAV' + % ob.getId()) if not ob.cb_isMoveable(): - raise CopyError, eNotSupported % escape(id) + raise CopyError(eNotSupported % escape(id)) m=Moniker.Moniker(ob) oblist.append(m.dump()) cp=(1, oblist) @@ -128,7 +130,7 @@ for id in ids: ob=self._getOb(id) if not ob.cb_isCopyable(): - raise CopyError, eNotSupported % escape(id) + raise CopyError(eNotSupported % escape(id)) m=Moniker.Moniker(ob) oblist.append(m.dump()) cp=(0, oblist) @@ -175,12 +177,12 @@ else: cp = None if cp is None: - raise CopyError, eNoData + raise CopyError(eNoData) try: op, mdatas = _cb_decode(cp) except: - raise CopyError, eInvalid + raise CopyError(eInvalid) oblist = [] app = self.getPhysicalRoot() @@ -191,7 +193,7 @@ except ConflictError: raise except: - raise CopyError, eNotFound + raise CopyError(eNotFound) self._verifyObjectPaste(ob, validate_src=op+1) oblist.append(ob) @@ -201,17 +203,17 @@ for ob in oblist: orig_id = ob.getId() if not ob.cb_isCopyable(): - raise CopyError, eNotSupported % escape(orig_id) + raise CopyError(eNotSupported % escape(orig_id)) try: ob._notifyOfCopyTo(self, op=0) except ConflictError: raise except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title="Copy Error", message=sys.exc_info()[1], - action='manage_main') + action='manage_main')) id = self._get_id(orig_id) result.append({'id': orig_id, 'new_id': id}) @@ -240,20 +242,20 @@ for ob in oblist: orig_id = ob.getId() if not ob.cb_isMoveable(): - raise CopyError, eNotSupported % escape(orig_id) + raise CopyError(eNotSupported % escape(orig_id)) try: ob._notifyOfCopyTo(self, op=1) except ConflictError: raise except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title="Move Error", message=sys.exc_info()[1], - action='manage_main') + action='manage_main')) if not sanity_check(self, ob): - raise CopyError, "This object cannot be pasted into itself" + raise CopyError("This object cannot be pasted into itself") orig_container = aq_parent(aq_inner(ob)) if aq_base(orig_container) is aq_base(self): @@ -330,18 +332,18 @@ try: self._checkId(new_id) except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title='Invalid Id', message=sys.exc_info()[1], - action ='manage_main') + action ='manage_main')) ob = self._getOb(id) if ob.wl_isLocked(): - raise ResourceLockedError, ('Object "%s" is locked via WebDAV' + raise ResourceLockedError('Object "%s" is locked via WebDAV' % ob.getId()) if not ob.cb_isMoveable(): - raise CopyError, eNotSupported % escape(id) + raise CopyError(eNotSupported % escape(id)) self._verifyObjectPaste(ob) try: @@ -349,10 +351,10 @@ except ConflictError: raise except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title="Rename Error", message=sys.exc_info()[1], - action ='manage_main') + action ='manage_main')) notify(ObjectWillBeMovedEvent(ob, self, id, self, new_id)) @@ -396,14 +398,14 @@ """Clone an object, creating a new object with the given id. """ if not ob.cb_isCopyable(): - raise CopyError, eNotSupported % escape(ob.getId()) + raise CopyError(eNotSupported % escape(ob.getId())) try: self._checkId(id) except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title='Invalid Id', message=sys.exc_info()[1], - action ='manage_main') + action ='manage_main')) self._verifyObjectPaste(ob) @@ -412,10 +414,10 @@ except ConflictError: raise except: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title="Clone Error", message=sys.exc_info()[1], - action='manage_main') + action='manage_main')) orig_ob = ob ob = ob._getCopy(self) @@ -469,17 +471,17 @@ # heirarchy). if not hasattr(object, 'meta_type'): - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title = 'Not Supported', message = ('The object <em>%s</em> does not support this' \ ' operation' % escape(absattr(object.id))), - action = 'manage_main') + action = 'manage_main')) if not hasattr(self, 'all_meta_types'): - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title = 'Not Supported', message = 'Cannot paste into this object.', - action = 'manage_main') + action = 'manage_main')) method_name = None mt_permission = None @@ -510,19 +512,19 @@ if not sm.checkPermission(delete_objects, parent): raise Unauthorized('Delete not allowed.') else: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title = 'Insufficient Privileges', message = ('You do not possess the %s permission in the ' 'context of the container into which you are ' 'pasting, thus you are not able to perform ' 'this operation.' % mt_permission), - action = 'manage_main') + action = 'manage_main')) else: - raise CopyError, MessageDialog( + raise CopyError(MessageDialog( title = 'Not Supported', message = ('The object <em>%s</em> does not support this ' 'operation.' % escape(absattr(object.id))), - action = 'manage_main') + action = 'manage_main')) InitializeClass(CopyContainer) @@ -561,13 +563,13 @@ transaction.savepoint(optimistic=True) if self._p_jar is None: - raise CopyError, ( + raise CopyError(( 'Object "%s" needs to be in the database to be copied' % - `self`) + `self`)) if container._p_jar is None: - raise CopyError, ( + raise CopyError(( 'Container "%s" needs to be in the database' % - `container`) + `container`)) # Ask an object for a new copy of itself. f=tempfile.TemporaryFile() Modified: Zope/trunk/lib/python/OFS/tests/testCopySupport.py =================================================================== --- Zope/trunk/lib/python/OFS/tests/testCopySupport.py 2008-09-27 11:31:03 UTC (rev 91556) +++ Zope/trunk/lib/python/OFS/tests/testCopySupport.py 2008-09-27 11:35:11 UTC (rev 91557) @@ -347,7 +347,7 @@ if ce_regex is not None: pattern = re.compile( ce_regex, re.DOTALL ) - if pattern.search( e ) is None: + if pattern.search( e.message ) is None: self.fail( "Paste failed; didn't match pattern:\n%s" % e ) else: Modified: Zope/trunk/lib/python/ZServer/tests/test_clockserver.py =================================================================== --- Zope/trunk/lib/python/ZServer/tests/test_clockserver.py 2008-09-27 11:31:03 UTC (rev 91556) +++ Zope/trunk/lib/python/ZServer/tests/test_clockserver.py 2008-09-27 11:35:11 UTC (rev 91557) @@ -95,12 +95,7 @@ logger=logger) self.assertEqual(server.handle_write(), True) - def test_handle_error(self): - logger = DummyLogger() - server = self._makeOne(method='a', period=60, user='charlie', - password='brown', host='localhost', - logger=logger) - self.assertRaises(AssertionError, server.handle_error) + #def test_handle_error(self): Can't be usefully tested def test_readable(self): logger = DummyLogger() _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins