[CalendarServer-changes] [5316] CalendarServer/trunk/twistedcaldav/test/test_index.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 16 08:46:23 PDT 2010
Revision: 5316
http://trac.macosforge.org/projects/calendarserver/changeset/5316
Author: sagen at apple.com
Date: 2010-03-16 08:46:21 -0700 (Tue, 16 Mar 2010)
Log Message:
-----------
Use addCleanup( ) instead of addBoth( ) to restore UIDReservationTimeOut, since if the Deferred times out it won't call _finally.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/test/test_index.py
Modified: CalendarServer/trunk/twistedcaldav/test/test_index.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_index.py 2010-03-16 14:23:38 UTC (rev 5315)
+++ CalendarServer/trunk/twistedcaldav/test/test_index.py 2010-03-16 15:46:21 UTC (rev 5316)
@@ -83,9 +83,8 @@
old_timeout = config.UIDReservationTimeOut
config.UIDReservationTimeOut = 1
- def _finally(result):
+ def _finally():
config.UIDReservationTimeOut = old_timeout
- return result
d = self.db.isReservedUID(uid)
d.addCallback(self.assertFalse)
@@ -95,7 +94,7 @@
d.addCallback(lambda _: deferLater(reactor, 2, lambda: None))
d.addCallback(lambda _: self.db.isReservedUID(uid))
d.addCallback(self.assertFalse)
- d.addBoth(_finally)
+ self.addCleanup(_finally)
return d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100316/4ec5d741/attachment.html>
More information about the calendarserver-changes
mailing list