[CalendarServer-changes] [11887] CalendarServer/branches/users/glyph/whenNotProposed/twext/ enterprise/test/test_queue.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:21:49 PDT 2014
Revision: 11887
http://trac.calendarserver.org//changeset/11887
Author: glyph at apple.com
Date: 2013-11-04 12:07:32 -0800 (Mon, 04 Nov 2013)
Log Message:
-----------
Fix up the test.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py
Modified: CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py
===================================================================
--- CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py 2013-11-04 20:07:31 UTC (rev 11886)
+++ CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py 2013-11-04 20:07:32 UTC (rev 11887)
@@ -301,12 +301,16 @@
cph = ConnectionPoolHelper()
cph.setUp(self)
cph.pauseHolders()
- cph.factory.willConnect().executeWillFail(
- lambda: RuntimeError("execute fail")
- )
+ firstConnection = cph.factory.willConnect()
+ enqTxn = cph.createTransaction()
+ # Execute some SQL on the connection before enqueueing the work-item so
+ # that we don't get the initial-statement.
+ enqTxn.execSQL("some sql")
lq = LocalQueuer(cph.createTransaction)
- enqTxn = cph.createTransaction()
+ cph.flushHolders()
+ cph.pauseHolders()
wp = lq.enqueueWork(enqTxn, DummyWorkItem, a=3, b=4)
+ firstConnection.executeWillFail(lambda: RuntimeError("foo"))
d = wp.whenProposed()
r = cph.resultOf(d)
self.assertEquals(r, [])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/d545655f/attachment.html>
More information about the calendarserver-changes
mailing list