[CalendarServer-changes] [11981] CalendarServer/trunk/twext/who/test

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:18:22 PDT 2014


Revision: 11981
          http://trac.calendarserver.org//changeset/11981
Author:   wsanchez at apple.com
Date:     2013-11-19 18:49:52 -0800 (Tue, 19 Nov 2013)
Log Message:
-----------
More stub tests

Modified Paths:
--------------
    CalendarServer/trunk/twext/who/test/test_directory.py
    CalendarServer/trunk/twext/who/test/test_index.py

Modified: CalendarServer/trunk/twext/who/test/test_directory.py
===================================================================
--- CalendarServer/trunk/twext/who/test/test_directory.py	2013-11-20 01:29:56 UTC (rev 11980)
+++ CalendarServer/trunk/twext/who/test/test_directory.py	2013-11-20 02:49:52 UTC (rev 11981)
@@ -93,11 +93,9 @@
 
 
     def service(self, subClass=None):
-        if not hasattr(self, "_service"):
-            if subClass is None:
-                subClass = self.serviceClass
-            self._service = subClass(self.realmName)
-        return self._service
+        if subClass is None:
+            subClass = self.serviceClass
+        return subClass(self.realmName)
 
 
 

Modified: CalendarServer/trunk/twext/who/test/test_index.py
===================================================================
--- CalendarServer/trunk/twext/who/test/test_index.py	2013-11-20 01:29:56 UTC (rev 11980)
+++ CalendarServer/trunk/twext/who/test/test_index.py	2013-11-20 02:49:52 UTC (rev 11981)
@@ -52,6 +52,7 @@
     """
     Tests for indexed directory services.
     """
+
     def test_indexRecords_positive(self):
         """
         L{DirectoryService.indexRecords} ensures all record data is in the
@@ -127,7 +128,59 @@
         self.assertTrue(emptyIndex(service.index))
 
 
+    def test_indexedRecordsFromMatchExpression_startsWith(self):
+        """
+        L{DirectoryService.indexedRecordsFromMatchExpression} ...
+        """
+        service = self.service(
+            subClass=noLoadDirectoryService(self.serviceClass)
+        )
 
+        records = RecordStorage(service, DirectoryRecord)
+        service.indexRecords(records)
+
+        raise NotImplementedError()
+
+    test_indexedRecordsFromMatchExpression_startsWith.todo = "Unimplemented"
+
+
+    def test_indexedRecordsFromMatchExpression_contains(self):
+        """
+        L{DirectoryService.indexedRecordsFromMatchExpression} ...
+        """
+        raise NotImplementedError()
+
+    test_indexedRecordsFromMatchExpression_contains.todo = "Unimplemented"
+
+
+    def test_indexedRecordsFromMatchExpression_equals(self):
+        """
+        L{DirectoryService.indexedRecordsFromMatchExpression} ...
+        """
+        raise NotImplementedError()
+
+    test_indexedRecordsFromMatchExpression_equals.todo = "Unimplemented"
+
+
+    def test_unIndexedRecordsFromMatchExpression(self):
+        """
+        L{DirectoryService.unIndexedRecordsFromMatchExpression} ...
+        """
+        raise NotImplementedError()
+
+    test_unIndexedRecordsFromMatchExpression.todo = "Unimplemented"
+
+
+    def test_recordsFromNonCompoundExpression(self):
+        """
+        L{DirectoryService.recordsFromNonCompoundExpression} ...
+        """
+        raise NotImplementedError()
+
+    test_recordsFromNonCompoundExpression.todo = "Unimplemented"
+
+
+
 class DirectoryServiceTest(unittest.TestCase, BaseDirectoryServiceTest):
     """
     Tests for L{DirectoryService}.
@@ -167,33 +220,6 @@
         self.assertRaises(NotImplementedError, service.loadRecords)
 
 
-    def test_indexedRecordsFromMatchExpression(self):
-        """
-        L{DirectoryService.indexedRecordsFromMatchExpression} ...
-        """
-        raise NotImplementedError()
-
-    test_indexedRecordsFromMatchExpression.todo = "Unimplemented"
-
-
-    def test_unIndexedRecordsFromMatchExpression(self):
-        """
-        L{DirectoryService.unIndexedRecordsFromMatchExpression} ...
-        """
-        raise NotImplementedError()
-
-    test_unIndexedRecordsFromMatchExpression.todo = "Unimplemented"
-
-
-    def test_recordsFromNonCompoundExpression(self):
-        """
-        L{DirectoryService.recordsFromNonCompoundExpression} ...
-        """
-        raise NotImplementedError()
-
-    test_recordsFromNonCompoundExpression.todo = "Unimplemented"
-
-
     def _noop(self):
         """
         Does nothing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/01ddf67c/attachment.html>


More information about the calendarserver-changes mailing list