[CalendarServer-changes] [11889] CalendarServer/branches/users/glyph/whenNotProposed/twext/ enterprise

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:18:43 PDT 2014


Revision: 11889
          http://trac.calendarserver.org//changeset/11889
Author:   glyph at apple.com
Date:     2013-11-04 13:54:32 -0800 (Mon, 04 Nov 2013)
Log Message:
-----------
Oops.  Other tests were depending on the exact ordering of connection objects within the fixture, so restore it and add a new method that returns the proto-connection.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/fixtures.py
    CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py

Modified: CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/fixtures.py
===================================================================
--- CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/fixtures.py	2013-11-04 20:07:32 UTC (rev 11888)
+++ CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/fixtures.py	2013-11-04 21:54:32 UTC (rev 11889)
@@ -546,6 +546,19 @@
         """
         Used by tests to queue a successful result for connect().
         """
+        def thunk():
+            return FakeConnection(self)
+        self._connectResultQueue.append(thunk)
+
+
+    def willConnectTo(self):
+        """
+        Queue a successful result for connect() and immediately add it as a
+        child to this L{ConnectionFactory}.
+
+        @return: a connection object
+        @rtype: L{FakeConnection}
+        """
         aConnection = FakeConnection(self)
         def thunk():
             return aConnection

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:32 UTC (rev 11888)
+++ CalendarServer/branches/users/glyph/whenNotProposed/twext/enterprise/test/test_queue.py	2013-11-04 21:54:32 UTC (rev 11889)
@@ -301,7 +301,7 @@
         cph = ConnectionPoolHelper()
         cph.setUp(self)
         cph.pauseHolders()
-        firstConnection = cph.factory.willConnect()
+        firstConnection = cph.factory.willConnectTo()
         enqTxn = cph.createTransaction()
         # Execute some SQL on the connection before enqueueing the work-item so
         # that we don't get the initial-statement.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/cb2890e4/attachment.html>


More information about the calendarserver-changes mailing list