[CalendarServer-changes] [5672] CalendarServer/branches/new-store/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 3 09:58:44 PDT 2010


Revision: 5672
          http://trac.macosforge.org/projects/calendarserver/changeset/5672
Author:   glyph at apple.com
Date:     2010-06-03 09:58:41 -0700 (Thu, 03 Jun 2010)
Log Message:
-----------
propagate principalCollections everywhere (and tests for same)

Modified Paths:
--------------
    CalendarServer/branches/new-store/twistedcaldav/storebridge.py
    CalendarServer/branches/new-store/twistedcaldav/test/test_wrapping.py

Modified: CalendarServer/branches/new-store/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-06-03 16:58:15 UTC (rev 5671)
+++ CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-06-03 16:58:41 UTC (rev 5672)
@@ -1,4 +1,4 @@
-# -*- test-case-name: twistedcaldav -*-
+# -*- test-case-name: twistedcaldav.test.test_wrapping -*-
 ##
 # Copyright (c) 2005-2010 Apple Inc. All rights reserved.
 #
@@ -151,12 +151,14 @@
         )
 
         if newStoreObject is not None:
-            similar = CalendarObjectFile(newStoreObject, path)
+            similar = CalendarObjectFile(newStoreObject, path,
+                principalCollections=self._principalCollections)
         else:
             # FIXME: creation in http_PUT should talk to a specific resource
             # type; this is the domain of StoreCalendarObjectResource.
             # similar = ProtoCalendarObjectFile(self._newStoreCalendar, path)
-            similar = CalDAVFile(path)
+            similar = CalDAVFile(path,
+                principalCollections=self._principalCollections)
 
         # FIXME: tests should be failing without this line.
         # self.propagateTransaction(similar)

Modified: CalendarServer/branches/new-store/twistedcaldav/test/test_wrapping.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/test/test_wrapping.py	2010-06-03 16:58:15 UTC (rev 5671)
+++ CalendarServer/branches/new-store/twistedcaldav/test/test_wrapping.py	2010-06-03 16:58:41 UTC (rev 5672)
@@ -173,3 +173,19 @@
         )
         self.assertEquals(calDavFileCalendar._newStoreObject._path, 
                           calDavFileCalendar.fp)
+        self.assertEquals(calDavFileCalendar._principalCollections,
+                          frozenset([self.principalsResource]))
+
+
+    @inlineCallbacks
+    def test_lookupNewCalendarObject(self):
+        """
+        When a L{CalDAVFile} representing a new calendar object on a
+        L{CalDAVFile} representing an existing calendar collection, the list of
+        principal collections will be propagated down to it.
+        """
+        calDavFileCalendar = yield self.getResource(
+            "calendars/users/wsanchez/calendar/xyzzy.ics"
+        )
+        self.assertEquals(calDavFileCalendar._principalCollections,
+                          frozenset([self.principalsResource]))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100603/debb6cdd/attachment.html>


More information about the calendarserver-changes mailing list