[CalendarServer-changes] [5628] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed May 19 15:29:06 PDT 2010


Revision: 5628
          http://trac.macosforge.org/projects/calendarserver/changeset/5628
Author:   glyph at apple.com
Date:     2010-05-19 15:29:03 -0700 (Wed, 19 May 2010)
Log Message:
-----------
Skip testing of mutable default keys.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/twistedcaldav/test/test_config.py

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2010-05-19 22:14:00 UTC (rev 5627)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2010-05-19 22:29:03 UTC (rev 5628)
@@ -618,23 +618,26 @@
         return configDict
 
 
+RELATIVE_PATHS = [("ServerRoot", "DataRoot"),
+                  ("ServerRoot", "DocumentRoot"),
+                  ("ServerRoot", "ConfigRoot"),
+                  ("ServerRoot", "LogRoot"),
+                  ("ServerRoot", "RunRoot"),
+                  ("ConfigRoot", "SudoersFile"),
+                  ("LogRoot", "AccessLogFile"),
+                  ("LogRoot", "ErrorLogFile"),
+                  ("LogRoot", "AccountingLogRoot"),
+                  ("RunRoot", "PIDFile"),
+                  ("RunRoot", "GlobalStatsSocket"),
+                  ("RunRoot", "ControlSocket")]
+
+
 def _updateDataStore(configDict):
     """
     Post-update configuration hook for making all configured paths relative to
     their respective root directories rather than the current working directory.
     """
-    for root, relativePath in [("ServerRoot", "DataRoot"),
-                               ("ServerRoot", "DocumentRoot"),
-                               ("ServerRoot", "ConfigRoot"),
-                               ("ServerRoot", "LogRoot"),
-                               ("ServerRoot", "RunRoot"),
-                               ("ConfigRoot", "SudoersFile"),
-                               ("LogRoot", "AccessLogFile"),
-                               ("LogRoot", "ErrorLogFile"),
-                               ("LogRoot", "AccountingLogRoot"),
-                               ("RunRoot", "PIDFile"),
-                               ("RunRoot", "GlobalStatsSocket"),
-                               ("RunRoot", "ControlSocket")]:
+    for root, relativePath in RELATIVE_PATHS:
         if root in configDict and relativePath in configDict:
             previousAbsoluteName = ".absolute." + relativePath
             previousRelativeName = ".relative." + relativePath

Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_config.py	2010-05-19 22:14:00 UTC (rev 5627)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py	2010-05-19 22:29:03 UTC (rev 5628)
@@ -14,12 +14,13 @@
 # limitations under the License.
 ##
 
-from twext.python.plistlib import writePlist
+from twext.python.plistlib import writePlist #@UnresolvedImport
 from twext.python.log import logLevelForNamespace
 
 from twistedcaldav.config import config, ConfigDict
 from twistedcaldav.static import CalDAVFile
-from twistedcaldav.stdconfig import DEFAULT_CONFIG, PListConfigProvider
+from twistedcaldav.stdconfig import DEFAULT_CONFIG, PListConfigProvider,\
+    RELATIVE_PATHS
 from twistedcaldav.test.util import TestCase
 
 testConfig = """<?xml version="1.0" encoding="UTF-8"?>
@@ -65,7 +66,9 @@
             if key in ("ServerHostName",):
                 # Value is calculated and may vary
                 continue
-
+            if key in (item[1] for item in RELATIVE_PATHS):
+                # These are covered by test_stdconfig.
+                continue
             self.assertEquals(
                 getattr(config, key), value,
                 "config[%r] == %r, expected %r"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100519/b54ae6b7/attachment.html>


More information about the calendarserver-changes mailing list