[CalendarServer-changes] [10582] CalendarServer/branches/users/glyph/unshare-when-access-revoked

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 28 19:29:06 PST 2013


Revision: 10582
          http://trac.calendarserver.org//changeset/10582
Author:   glyph at apple.com
Date:     2013-01-28 19:29:06 -0800 (Mon, 28 Jan 2013)
Log Message:
-----------
Cleanup and documentation for setupCalendars.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/test/util.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/unshare-when-access-revoked/

Modified: CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/test/util.py
===================================================================
--- CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/test/util.py	2013-01-29 03:29:04 UTC (rev 10581)
+++ CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/test/util.py	2013-01-29 03:29:06 UTC (rev 10582)
@@ -177,25 +177,30 @@
 
     def setupCalendars(self):
         """
-        Set up the resource at /calendars (a
-        L{DirectoryCalendarHomeProvisioningResource}), and assign it as
-        C{self.calendarCollection}.
+        When a directory service exists, set up the resources at C{/calendars}
+        and C{/addressbooks} (a L{DirectoryCalendarHomeProvisioningResource}
+        and L{DirectoryAddressBookHomeProvisioningResource} respectively), and
+        assign them to the C{self.calendarCollection} and
+        C{self.addressbookCollection} attributes.
+
+        A directory service may be associated with this L{TestCase} with
+        L{TestCase.createStockDirectoryService} or
+        L{TestCase.directoryFixture.addDirectoryService}.
         """
         newStore = self.createDataStore()
+        @self.directoryFixture.whenDirectoryServiceChanges
         def putAllChildren(ds):
             self.calendarCollection = (
                 DirectoryCalendarHomeProvisioningResource(
                     ds, "/calendars/", newStore
                 ))
-            self.site.resource.putChild("calendars",
-                                        self.calendarCollection)
+            self.site.resource.putChild("calendars", self.calendarCollection)
             self.addressbookCollection = (
                 DirectoryAddressBookHomeProvisioningResource(
                     ds, "/addressbooks/", newStore
                 ))
             self.site.resource.putChild("addressbooks",
                                         self.addressbookCollection)
-        self.directoryFixture.whenDirectoryServiceChanges(putAllChildren)
 
 
     def configure(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130128/2baf13a7/attachment.html>


More information about the calendarserver-changes mailing list