[CalendarServer-changes] [622] CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/ directory/test

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 28 19:07:24 PST 2006


Revision: 622
          http://trac.macosforge.org/projects/calendarserver/changeset/622
Author:   wsanchez at apple.com
Date:     2006-11-28 19:07:23 -0800 (Tue, 28 Nov 2006)

Log Message:
-----------
Have the SQLDB test inherrit from the XMLFile test.

Add digest tests to SQLDB.

Disable diest auth test because SQLDirectoryService doesn't set the
realmName attribute, which we need.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_sqldb.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_xmlfile.py

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py	2006-11-29 02:43:20 UTC (rev 621)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py	2006-11-29 03:07:23 UTC (rev 622)
@@ -31,7 +31,10 @@
     import twistedcaldav.directory.appleopendirectory
     twistedcaldav.directory.appleopendirectory.reactor = DummyReactor
 
-    class OpenDirectory (twistedcaldav.directory.test.util.BasicTestCase, twistedcaldav.directory.test.util.DigestTestCase):
+    class OpenDirectory (
+        twistedcaldav.directory.test.util.BasicTestCase,
+        twistedcaldav.directory.test.util.DigestTestCase
+    ):
         """
         Test Open Directory directory implementation.
         """

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_sqldb.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_sqldb.py	2006-11-29 02:43:20 UTC (rev 621)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_sqldb.py	2006-11-29 03:07:23 UTC (rev 622)
@@ -21,47 +21,24 @@
 from twisted.python.filepath import FilePath
 
 import twistedcaldav.directory.test.util
+import twistedcaldav.directory.test.test_xmlfile
 from twistedcaldav.directory.sqldb import SQLDirectoryService
 
 xmlFile = FilePath(os.path.join(os.path.dirname(__file__), "accounts.xml"))
 
 # FIXME: Add tests for GUID hooey, once we figure out what that means here
 
-class Basic (twistedcaldav.directory.test.util.BasicTestCase):
+class SQLDB (
+    twistedcaldav.directory.test.test_xmlfile.XMLFileBase,
+    twistedcaldav.directory.test.util.BasicTestCase,
+    twistedcaldav.directory.test.util.DigestTestCase
+):
     """
     Test SQL directory implementation.
     """
-    recordTypes = set(("user", "group", "resource"))
-
-    users = {
-        "admin"   : "nimda",
-        "proxy"   : "yxorp",
-        "wsanchez": "zehcnasw",
-        "cdaboo"  : "oobadc",
-        "lecroy"  : "yorcel",
-        "dreid"   : "dierd",
-        "user01"  : "01user",
-        "user02"  : "02user",
-    }
-
-    groups = {
-        "managers"   : ("lecroy",),
-        "grunts"     : ("wsanchez", "cdaboo", "dreid"),
-        "right_coast": ("cdaboo",),
-        "left_coast" : ("wsanchez", "dreid", "lecroy"),
-    }
-
-    resources = set((
-        "mercury",
-        "gemini",
-        "apollo",
-    ))
-
-    def xmlFile(self):
-        if not hasattr(self, "_xmlFile"):
-            self._xmlFile = FilePath(self.mktemp())
-            xmlFile.copyTo(self._xmlFile)
-        return self._xmlFile
-
     def service(self):
         return SQLDirectoryService(os.getcwd(), self.xmlFile())
+
+    def test_verifyCredentials_digest(self):
+        raise NotImplementedError("Use super's implementation")
+    test_verifyCredentials_digest.todo = "FIXME: SQLDirectoryService.realmName is None"

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_xmlfile.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_xmlfile.py	2006-11-29 02:43:20 UTC (rev 621)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_xmlfile.py	2006-11-29 03:07:23 UTC (rev 622)
@@ -27,10 +27,7 @@
 
 # FIXME: Add tests for GUID hooey, once we figure out what that means here
 
-class XMLFile (twistedcaldav.directory.test.util.BasicTestCase, twistedcaldav.directory.test.util.DigestTestCase):
-    """
-    Test XML file based directory implementation.
-    """
+class XMLFileBase(object):
     recordTypes = set(("user", "group", "resource"))
 
     users = {
@@ -63,6 +60,14 @@
             xmlFile.copyTo(self._xmlFile)
         return self._xmlFile
 
+class XMLFile (
+    XMLFileBase,
+    twistedcaldav.directory.test.util.BasicTestCase,
+    twistedcaldav.directory.test.util.DigestTestCase
+):
+    """
+    Test XML file based directory implementation.
+    """
     def service(self):
         return XMLDirectoryService(self.xmlFile())
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061128/43a815f9/attachment.html


More information about the calendarserver-changes mailing list