[CalendarServer-changes] [11567] CalendarServer/trunk/txdav/common/datastore/test/util.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 30 11:46:38 PDT 2013


Revision: 11567
          http://trac.calendarserver.org//changeset/11567
Author:   cdaboo at apple.com
Date:     2013-07-30 11:46:38 -0700 (Tue, 30 Jul 2013)
Log Message:
-----------
Always empty the attachments directory when creating a new store for testing.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/test/util.py

Modified: CalendarServer/trunk/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/util.py	2013-07-30 18:35:38 UTC (rev 11566)
+++ CalendarServer/trunk/txdav/common/datastore/test/util.py	2013-07-30 18:46:38 UTC (rev 11567)
@@ -236,10 +236,12 @@
 
         @return: a L{Deferred} that fires with a L{CommonDataStore}
         """
-        try:
-            attachmentRoot.createDirectory()
-        except OSError:
-            pass
+
+        # Always clean-out old attachments
+        if attachmentRoot.exists():
+            attachmentRoot.remove()
+        attachmentRoot.createDirectory()
+
         currentTestID = testCase.id()
         cp = ConnectionPool(self.sharedService.produceConnection,
                             maxConnections=5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130730/d2a8d37c/attachment.html>


More information about the calendarserver-changes mailing list