[CalendarServer-changes] [7756] CalendarServer/trunk/contrib/performance/loadtest

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 11 13:36:35 PDT 2011


Revision: 7756
          http://trac.macosforge.org/projects/calendarserver/changeset/7756
Author:   exarkun at twistedmatrix.com
Date:     2011-07-11 13:36:34 -0700 (Mon, 11 Jul 2011)
Log Message:
-----------
Make all of the xmpp-* attributes optional

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/loadtest/ical.py
    CalendarServer/trunk/contrib/performance/loadtest/test_ical.py

Modified: CalendarServer/trunk/contrib/performance/loadtest/ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-11 18:35:33 UTC (rev 7755)
+++ CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-11 20:36:34 UTC (rev 7756)
@@ -297,11 +297,15 @@
 
             if principal == calendarHome:
                 text = principals[principal].getTextProperties()
-                server = text[csxml.xmpp_server]
-                uri = text[csxml.xmpp_uri]
-                pushkey = text[csxml.pushkey]
-                if server and uri:
-                    self.xmpp[principal] = XMPPPush(server, uri, pushkey)
+                try:
+                    server = text[csxml.xmpp_server]
+                    uri = text[csxml.xmpp_uri]
+                    pushkey = text[csxml.pushkey]
+                except KeyError:
+                    pass
+                else:
+                    if server and uri:
+                        self.xmpp[principal] = XMPPPush(server, uri, pushkey)
 
             nodes = principals[principal].getNodeProperties()
             for nodeType in nodes[davxml.resourcetype].getchildren():

Modified: CalendarServer/trunk/contrib/performance/loadtest/test_ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/test_ical.py	2011-07-11 18:35:33 UTC (rev 7755)
+++ CalendarServer/trunk/contrib/performance/loadtest/test_ical.py	2011-07-11 20:36:34 UTC (rev 7756)
@@ -809,7 +809,9 @@
         <xmpp-uri xmlns='http://calendarserver.org/ns/'>xmpp:pubsub.xmpp.example.invalid?pubsub;node=/CalDAV/another.example.invalid/user01/</xmpp-uri>""",
     }
 
+CALENDAR_HOME_PROPFIND_RESPONSE_XMPP_MISSING = _CALENDAR_HOME_PROPFIND_RESPONSE_TEMPLATE % {"xmpp": ""}
 
+
 class MemoryResponse(object):
     def __init__(self, version, code, phrase, headers, bodyProducer):
         self.version = version
@@ -946,6 +948,13 @@
                          self.client.xmpp)
 
 
+    def test_handleMissingXMPP(self):
+        home = "/calendars/__uids__/user01/"
+        self.client._extractCalendars(
+            CALENDAR_HOME_PROPFIND_RESPONSE_XMPP_MISSING, home)
+        self.assertEqual({}, self.client.xmpp)
+
+
     def test_changeEventAttendee(self):
         """
         SnowLeopard.changeEventAttendee removes one attendee from an
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110711/eb4b9a1c/attachment.html>


More information about the calendarserver-changes mailing list