[CalendarServer-changes] [7009] CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/ test

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 16 06:40:42 PST 2011


Revision: 7009
          http://trac.macosforge.org/projects/calendarserver/changeset/7009
Author:   glyph at apple.com
Date:     2011-02-16 06:40:42 -0800 (Wed, 16 Feb 2011)
Log Message:
-----------
Sync token tests for notifications.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/common.py
    CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/test_file.py

Modified: CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/common.py	2011-02-16 14:40:31 UTC (rev 7008)
+++ CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/common.py	2011-02-16 14:40:42 UTC (rev 7009)
@@ -279,6 +279,30 @@
 
 
     @inlineCallbacks
+    def test_notificationSyncToken(self):
+        """
+        L{ICalendar.resourceNamesSinceToken} will return the names of calendar
+        objects changed or deleted since 
+        """
+        txn = self.transactionUnderTest()
+        coll = yield txn.notificationsWithUID("home1")
+        invite1 = InviteNotification()
+        yield coll.writeNotificationObject("1", invite1, invite1.toxml())
+        st = yield coll.syncToken()
+        yield coll.writeNotificationObject("2", invite1, invite1.toxml())
+        rev = self.token2revision(st)
+        yield coll.removeNotificationObjectWithUID("1")
+        st2 = yield coll.syncToken()
+        rev2 = self.token2revision(st2)
+        changed, deleted = yield coll.resourceNamesSinceToken(rev)
+        self.assertEquals(set(changed), set(["2.xml"]))
+        self.assertEquals(set(deleted), set(["1.xml"]))
+        changed, deleted = yield coll.resourceNamesSinceToken(rev2)
+        self.assertEquals(set(changed), set([]))
+        self.assertEquals(set(deleted), set([]))
+
+
+    @inlineCallbacks
     def test_replaceNotification(self):
         """
         L{INotificationCollection.writeNotificationObject} will silently

Modified: CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/test_file.py
===================================================================
--- CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/test_file.py	2011-02-16 14:40:31 UTC (rev 7008)
+++ CalendarServer/branches/users/glyph/dalify/txdav/caldav/datastore/test/test_file.py	2011-02-16 14:40:42 UTC (rev 7009)
@@ -504,3 +504,11 @@
 
     test_simpleHomeSyncToken.skip = "Not in file store."
 
+
+    def test_notificationSyncToken(self):
+        """
+        File store doesn't have a functioning C{resourceNamesSinceToken} for
+        L{Notifications}.
+        """
+
+    test_notificationSyncToken.skip = "Not in file store."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110216/8e9ef855/attachment-0001.html>


More information about the calendarserver-changes mailing list