[CalendarServer-changes] [597] CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/ directory/test/test_opendirectory.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 27 17:11:05 PST 2006


Revision: 597
          http://trac.macosforge.org/projects/calendarserver/changeset/597
Author:   wsanchez at apple.com
Date:     2006-11-27 17:11:05 -0800 (Mon, 27 Nov 2006)

Log Message:
-----------
Add (weak) OpenDirectory tests.

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

Added: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py	                        (rev 0)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/test/test_opendirectory.py	2006-11-28 01:11:05 UTC (rev 597)
@@ -0,0 +1,41 @@
+##
+# Copyright (c) 2005-2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# DRI: Wilfredo Sanchez, wsanchez at apple.com
+##
+
+try:
+    from twistedcaldav.directory.appleopendirectory import OpenDirectoryService
+except ImportError:
+    pass
+else:
+    import twistedcaldav.directory.test.util
+
+    # Wonky hack to prevent unclean reactor shutdowns
+    class DummyReactor(object):
+        @staticmethod
+        def callLater(*args):
+            pass
+    import twistedcaldav.directory.appleopendirectory
+    twistedcaldav.directory.appleopendirectory.reactor = DummyReactor
+
+    class OpenDirectory (twistedcaldav.directory.test.util.BasicTestCase, twistedcaldav.directory.test.util.DigestTestCase):
+        """
+        Test Open Directory directory implementation.
+        """
+        recordTypes = set(("user", "group", "resource"))
+
+        def service(self):
+            return OpenDirectoryService(node="/Local")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061127/75cd8cd9/attachment.html


More information about the calendarserver-changes mailing list