[CalendarServer-changes] [6452] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 22 09:39:49 PDT 2010


Revision: 6452
          http://trac.macosforge.org/projects/calendarserver/changeset/6452
Author:   sagen at apple.com
Date:     2010-10-22 09:39:48 -0700 (Fri, 22 Oct 2010)
Log Message:
-----------
Remove xmpp- properties from addressbook home (push-aware AB clients will use push-transports)

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/test/test_resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2010-10-21 20:21:50 UTC (rev 6451)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2010-10-22 16:39:48 UTC (rev 6452)
@@ -2010,13 +2010,10 @@
         pass
 
     def liveProperties(self):
-        
+
         return super(CommonHomeResource, self).liveProperties() + (
             (customxml.calendarserver_namespace, "push-transports"),
             (customxml.calendarserver_namespace, "pushkey"),
-            (customxml.calendarserver_namespace, "xmpp-uri"),
-            (customxml.calendarserver_namespace, "xmpp-heartbeat-uri"),
-            (customxml.calendarserver_namespace, "xmpp-server"),
         )
 
     def sharesDB(self):
@@ -2484,7 +2481,14 @@
         returnValue((changed, deleted, notallowed))
 
 
+    def liveProperties(self):
 
+        return super(CalendarHomeResource, self).liveProperties() + (
+            (customxml.calendarserver_namespace, "xmpp-uri"),
+            (customxml.calendarserver_namespace, "xmpp-heartbeat-uri"),
+            (customxml.calendarserver_namespace, "xmpp-server"),
+        )
+
 class AddressBookHomeResource (CommonHomeResource):
     """
     Address book home collection resource.

Modified: CalendarServer/trunk/twistedcaldav/test/test_resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_resource.py	2010-10-21 20:21:50 UTC (rev 6451)
+++ CalendarServer/trunk/twistedcaldav/test/test_resource.py	2010-10-22 16:39:48 UTC (rev 6452)
@@ -14,7 +14,7 @@
 # limitations under the License.
 ##
 
-from twistedcaldav.resource import CalDAVResource
+from twistedcaldav.resource import CalDAVResource, CommonHomeResource, CalendarHomeResource, AddressBookHomeResource
 
 from twistedcaldav.test.util import InMemoryPropertyStore
 from twistedcaldav.test.util import TestCase
@@ -24,7 +24,11 @@
     def qname(self):
         return "StubQnamespace", "StubQname"
 
+class StubHome(object):
+    def properties(self):
+        return []
 
+
 class CalDAVResourceTests(TestCase):
     def setUp(self):
         TestCase.setUp(self)
@@ -36,3 +40,26 @@
         self.resource.writeDeadProperty(prop)
         self.assertEquals(self.resource._dead_properties.get(("StubQnamespace", "StubQname")),
                           prop)
+
+class CommonHomeResourceTests(TestCase):
+
+    def test_commonHomeliveProperties(self):
+        resource = CommonHomeResource(None, None, None, StubHome())
+        self.assertTrue(('http://calendarserver.org/ns/', 'push-transports') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'pushkey') in resource.liveProperties())
+
+    def test_calendarHomeliveProperties(self):
+        resource = CalendarHomeResource(None, None, None, StubHome())
+        self.assertTrue(('http://calendarserver.org/ns/', 'push-transports') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'pushkey') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-uri') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-heartbeat-uri') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-server') in resource.liveProperties())
+
+    def test_addressBookHomeliveProperties(self):
+        resource = AddressBookHomeResource(None, None, None, StubHome())
+        self.assertTrue(('http://calendarserver.org/ns/', 'push-transports') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'pushkey') in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-uri') not in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-heartbeat-uri') not in resource.liveProperties())
+        self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-server') not in resource.liveProperties())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101022/cd7a4bb1/attachment.html>


More information about the calendarserver-changes mailing list