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

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


Revision: 9071
          http://trac.macosforge.org/projects/calendarserver/changeset/9071
Author:   glyph at apple.com
Date:     2012-04-13 11:45:15 -0700 (Fri, 13 Apr 2012)
Log Message:
-----------
stopConnecting otherwise just raises an exception

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:09 UTC (rev 9070)
+++ CalendarServer/branches/users/glyph/ipv6-client/twext/internet/adaptendpoint.py	2012-04-13 18:45:15 UTC (rev 9071)
@@ -81,6 +81,8 @@
 
 
     def stopConnecting(self):
+        if self.wrapper._outstandingAttempt is None:
+            raise RuntimeError("no connection attempt in progress")
         self.wrapper.disconnect()
 
 

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:09 UTC (rev 9070)
+++ CalendarServer/branches/users/glyph/ipv6-client/twext/internet/test/test_adaptendpoint.py	2012-04-13 18:45:15 UTC (rev 9071)
@@ -240,3 +240,13 @@
         self.assertTrue(self.factory.fails[0].reason.check(CancelledError))
 
 
+    def test_stopConnectingWhileConnected(self):
+        """
+        When the L{IConnector} is told to C{stopConnecting} while already
+        connected, it raises a L{RuntimeError}.
+        """
+        self.connectionSucceeds()
+        self.assertRaises(RuntimeError, self.connector.stopConnecting)
+
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120413/b6bc8e09/attachment-0001.html>


More information about the calendarserver-changes mailing list