[CalendarServer-changes] [5941] CalendarServer/branches/new-store-no-caldavfile-2/twistedcaldav/test /util.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 26 12:44:40 PDT 2010


Revision: 5941
          http://trac.macosforge.org/projects/calendarserver/changeset/5941
Author:   glyph at apple.com
Date:     2010-07-26 12:44:40 -0700 (Mon, 26 Jul 2010)
Log Message:
-----------
hack around the removal of .fp for now

Modified Paths:
--------------
    CalendarServer/branches/new-store-no-caldavfile-2/twistedcaldav/test/util.py

Modified: CalendarServer/branches/new-store-no-caldavfile-2/twistedcaldav/test/util.py
===================================================================
--- CalendarServer/branches/new-store-no-caldavfile-2/twistedcaldav/test/util.py	2010-07-26 19:44:16 UTC (rev 5940)
+++ CalendarServer/branches/new-store-no-caldavfile-2/twistedcaldav/test/util.py	2010-07-26 19:44:40 UTC (rev 5941)
@@ -33,7 +33,7 @@
 from twisted.internet.protocol import ProcessProtocol
 
 from twext.python.memcacheclient import ClientFactory
-from twext.python.filepath import CachingFilePath as FilePath
+from twext.python.filepath import CachingFilePath as FilePath, CachingFilePath
 import twext.web2.dav.test.util
 from twext.web2.dav import davxml
 from twext.web2.dav.static import DAVFile
@@ -101,11 +101,10 @@
         Set up the resource at /calendars (a L{DirectoryCalendarHomeProvisioningResource}),
         and assign it as C{self.calendarCollection}.
         """
-        path = self.site.resource.fp.child("calendars")
-        path.createDirectory()
 
         # Need a data store
-        _newStore = CommonDataStore(self.site.resource.fp, True, False)
+        _newStore = CommonDataStore(CachingFilePath(config.DocumentRoot),
+                                    True, False)
 
         self.calendarCollection = DirectoryCalendarHomeProvisioningResource(
             self.directoryService,
@@ -114,9 +113,6 @@
         )
         self.site.resource.putChild("calendars", self.calendarCollection)
 
-        path = self.site.resource.fp.child("addressbooks")
-        path.createDirectory()
-
         self.addressbookCollection = DirectoryAddressBookHomeProvisioningResource(
             self.directoryService,
             "/addressbooks/",
@@ -309,6 +305,7 @@
         super(HomeTestCase, self).setUp()
 
         fp = FilePath(self.mktemp())
+        fp.createDirectory()
 
         self.createStockDirectoryService()
 
@@ -320,12 +317,14 @@
             _newStore
         )
         
-        def _defer(_):
+        def _defer(user):
             # Commit the transaction
             self.site.resource._associatedTransaction.commit()
-            
+            self.docroot = user._newStoreCalendarHome._path.path
+
         return self._refreshRoot().addCallback(_defer)
 
+
     @inlineCallbacks
     def _refreshRoot(self):
         """
@@ -344,10 +343,8 @@
         # Fix the site to point directly at the user's calendar home so that we
         # can focus on testing just that rather than hierarchy traversal..
         self.site.resource = user
+        returnValue(user)
 
-        # Fix the docroot so that 'mkdtemp' will create directories in the right
-        # place (beneath the calendar).
-        self.docroot = user.fp.path
 
     @inlineCallbacks
     def send(self, request, callback):
@@ -410,9 +407,6 @@
         # can focus on testing just that rather than hierarchy traversal..
         self.site.resource = user
 
-        # Fix the docroot so that 'mkdtemp' will create directories in the right
-        # place (beneath the calendar).
-        self.docroot = user.fp.path
 
     @inlineCallbacks
     def send(self, request, callback):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100726/d6808283/attachment.html>


More information about the calendarserver-changes mailing list