[CalendarServer-changes] [5627] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed May 19 15:14:03 PDT 2010


Revision: 5627
          http://trac.macosforge.org/projects/calendarserver/changeset/5627
Author:   glyph at apple.com
Date:     2010-05-19 15:14:00 -0700 (Wed, 19 May 2010)
Log Message:
-----------
Test setup fixes to accommodate configuration relative-path updates.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/__init__.py
    CalendarServer/trunk/calendarserver/tools/test/test_gateway.py
    CalendarServer/trunk/calendarserver/tools/test/test_principals.py
    CalendarServer/trunk/calendarserver/tools/test/test_purge.py
    CalendarServer/trunk/twext/web2/dav/test/util.py
    CalendarServer/trunk/twistedcaldav/test/test_accounting.py

Modified: CalendarServer/trunk/calendarserver/__init__.py
===================================================================
--- CalendarServer/trunk/calendarserver/__init__.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/calendarserver/__init__.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -1,3 +1,4 @@
+# -*- test-case-name: calendarserver -*-
 ##
 # Copyright (c) 2005-2007 Apple Inc. All rights reserved.
 #

Modified: CalendarServer/trunk/calendarserver/tools/test/test_gateway.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_gateway.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/calendarserver/tools/test/test_gateway.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -49,8 +49,6 @@
         self.configFileName = configFilePath.path
         config.load(self.configFileName)
 
-        os.makedirs(config.DataRoot)
-
         origUsersFile = FilePath(os.path.join(os.path.dirname(__file__),
             "gateway", "users-groups.xml"))
         copyUsersFile = FilePath(os.path.join(config.DataRoot, "accounts.xml"))

Modified: CalendarServer/trunk/calendarserver/tools/test/test_principals.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_principals.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/calendarserver/tools/test/test_principals.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -50,8 +50,6 @@
         self.configFileName = configFilePath.path
         config.load(self.configFileName)
 
-        os.makedirs(config.DataRoot)
-
         origUsersFile = FilePath(os.path.join(os.path.dirname(__file__),
             "principals", "users-groups.xml"))
         copyUsersFile = FilePath(os.path.join(config.DataRoot, "accounts.xml"))
@@ -73,6 +71,7 @@
         reactor.callLater(0, d.callback, True)
         return d
 
+
     @inlineCallbacks
     def runCommand(self, *additional):
         """

Modified: CalendarServer/trunk/calendarserver/tools/test/test_purge.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_purge.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/calendarserver/tools/test/test_purge.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -345,11 +345,8 @@
     def setUp(self):
         super(DeprovisionTestCase, self).setUp()
 
-        testRoot = os.path.join(os.path.dirname(__file__), "deprovision")
-        templateName = os.path.join(testRoot, "caldavd.plist")
-        templateFile = open(templateName)
-        template = templateFile.read()
-        templateFile.close()
+        testRootPath = FilePath(__file__).sibling("deprovision")
+        template = testRootPath.child("caldavd.plist").getContent()
 
         newConfig = template % {
             "ServerRoot" : os.path.abspath(config.ServerRoot),
@@ -360,22 +357,19 @@
         self.configFileName = configFilePath.path
         config.load(self.configFileName)
 
-        os.makedirs(config.DataRoot)
-        os.makedirs(config.DocumentRoot)
-
-        origUsersFile = FilePath(os.path.join(os.path.dirname(__file__),
-            "deprovision", "users-groups.xml"))
-        copyUsersFile = FilePath(os.path.join(config.DataRoot, "accounts.xml"))
+        origUsersFile = FilePath(__file__).sibling(
+            "deprovision").child("users-groups.xml")
+        copyUsersFile = FilePath(config.DataRoot).child("accounts.xml")
         origUsersFile.copyTo(copyUsersFile)
 
-        origResourcesFile = FilePath(os.path.join(os.path.dirname(__file__),
-            "deprovision", "resources-locations.xml"))
-        copyResourcesFile = FilePath(os.path.join(config.DataRoot, "resources.xml"))
+        origResourcesFile = FilePath(__file__).sibling(
+            "deprovision").child("resources-locations.xml")
+        copyResourcesFile = FilePath(config.DataRoot).child("resources.xml")
         origResourcesFile.copyTo(copyResourcesFile)
 
-        origAugmentFile = FilePath(os.path.join(os.path.dirname(__file__),
-            "deprovision", "augments.xml"))
-        copyAugmentFile = FilePath(os.path.join(config.DataRoot, "augments.xml"))
+        origAugmentFile = FilePath(__file__).sibling(
+            "deprovision").child("augments.xml")
+        copyAugmentFile = FilePath(config.DataRoot).child("augments.xml")
         origAugmentFile.copyTo(copyAugmentFile)
 
         self.rootResource = getRootResource(config)

Modified: CalendarServer/trunk/twext/web2/dav/test/util.py
===================================================================
--- CalendarServer/trunk/twext/web2/dav/test/util.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/twext/web2/dav/test/util.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -196,7 +196,7 @@
         path = mkdtemp(prefix=prefix + "_", dir=self.docroot)
         uri  = joinURL("/", url_quote(os.path.basename(path))) + "/"
 
-        return (path, uri)
+        return (os.path.abspath(path), uri)
 
     def send(self, request, callback):
         log.msg("Sending %s request for URI %s" % (request.method, request.uri))

Modified: CalendarServer/trunk/twistedcaldav/test/test_accounting.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_accounting.py	2010-05-19 21:09:41 UTC (rev 5626)
+++ CalendarServer/trunk/twistedcaldav/test/test_accounting.py	2010-05-19 22:14:00 UTC (rev 5627)
@@ -27,7 +27,6 @@
 class AccountingITIP (twistedcaldav.test.util.TestCase):
 
     def setUp(self):
-        
         super(AccountingITIP, self).setUp()
         config.AccountingCategories.iTIP = True
         config.AccountingPrincipals = ["*",]
@@ -60,9 +59,8 @@
         """
         
         # Make log root a file
-        config.AccountingLogRoot = self.mktemp()
+        config.AccountingLogRoot = os.path.abspath(self.mktemp())
         open(config.AccountingLogRoot, "w").close()
-        
         emitAccounting("iTIP", self._Principal("1234-5678"), "bogus")
 
 class AccountingHTTP (twistedcaldav.test.util.TestCase):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100519/158d6562/attachment-0001.html>


More information about the calendarserver-changes mailing list