[CalendarServer-changes] [9070] CalendarServer/branches/users/glyph/ipv6-client/twext/internet

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 13 11:45:09 PDT 2012


Revision: 9070
          http://trac.macosforge.org/projects/calendarserver/changeset/9070
Author:   glyph at apple.com
Date:     2012-04-13 11:45:09 -0700 (Fri, 13 Apr 2012)
Log Message:
-----------
first approximation of stopConnecting

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/ipv6-client/twext/internet/adaptendpoint.py
    CalendarServer/branches/users/glyph/ipv6-client/twext/internet/test/test_adaptendpoint.py

Modified: CalendarServer/branches/users/glyph/ipv6-client/twext/internet/adaptendpoint.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/twext/internet/adaptendpoint.py	2012-04-13 18:45:03 UTC (rev 9069)
+++ CalendarServer/branches/users/glyph/ipv6-client/twext/internet/adaptendpoint.py	2012-04-13 18:45:09 UTC (rev 9070)
@@ -81,7 +81,7 @@
 
 
     def stopConnecting(self):
-        pass
+        self.wrapper.disconnect()
 
 
     def disconnect(self):

Modified: CalendarServer/branches/users/glyph/ipv6-client/twext/internet/test/test_adaptendpoint.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/twext/internet/test/test_adaptendpoint.py	2012-04-13 18:45:03 UTC (rev 9069)
+++ CalendarServer/branches/users/glyph/ipv6-client/twext/internet/test/test_adaptendpoint.py	2012-04-13 18:45:09 UTC (rev 9070)
@@ -230,3 +230,13 @@
         self.assertEqual(len(self.endpoint.attempts), 1)
 
 
+    def test_stopConnectingWhileConnecting(self):
+        """
+        When the L{IConnector} is told to C{stopConnecting} while another
+        attempt is still in flight, it cancels that connection.
+        """
+        self.connector.stopConnecting()
+        self.assertEqual(len(self.factory.fails), 1)
+        self.assertTrue(self.factory.fails[0].reason.check(CancelledError))
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120413/9b9b345d/attachment.html>


More information about the calendarserver-changes mailing list