[Zope-Checkins] SVN: Zope/trunk/src/Products/ZCatalog/tests/test_plan.py Document my test debt

Hanno Schlichting hannosch at hannosch.eu
Thu Aug 5 14:19:37 EDT 2010


Log message for revision 115505:
  Document my test debt
  

Changed:
  U   Zope/trunk/src/Products/ZCatalog/tests/test_plan.py

-=-
Modified: Zope/trunk/src/Products/ZCatalog/tests/test_plan.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/tests/test_plan.py	2010-08-05 16:23:44 UTC (rev 115504)
+++ Zope/trunk/src/Products/ZCatalog/tests/test_plan.py	2010-08-05 18:19:36 UTC (rev 115505)
@@ -13,7 +13,9 @@
 
 import unittest
 
+from zope.testing import cleanup
 
+
 class dummy(object):
 
     def __init__(self, num):
@@ -26,9 +28,21 @@
         return (self.num, self.num + 1)
 
 
-class TestCatalogPlan(unittest.TestCase):
+# class TestNestedDict(unittest.TestCase):
 
+# class TestPriorityMap(unittest.TestCase):
+
+# class TestReports(unittest.TestCase):
+
+# class TestValueIndexes(unittest.TestCase):
+
+# class TestMakeKey(unittest.TestCase):
+
+
+class TestCatalogPlan(cleanup.CleanUp, unittest.TestCase):
+
     def setUp(self):
+        cleanup.CleanUp.setUp(self)
         from Products.ZCatalog.ZCatalog import ZCatalog
         self.zcat = ZCatalog('catalog')
         self.zcat.long_query_time = 0.0
@@ -40,10 +54,31 @@
             obj = dummy(i)
             self.zcat.catalog_object(obj, str(i))
 
-    def tearDown(self):
-        from Products.ZCatalog.plan import ValueIndexes
-        ValueIndexes.clear()
+    # get_id
+    # init_timer
+    # plan
+    # start
+    # start_split
+    # stop_split
+    # stop
+    # log
 
+
+class TestCatalogReport(cleanup.CleanUp, unittest.TestCase):
+
+    def setUp(self):
+        cleanup.CleanUp.setUp(self)
+        from Products.ZCatalog.ZCatalog import ZCatalog
+        self.zcat = ZCatalog('catalog')
+        self.zcat.long_query_time = 0.0
+        self.zcat.addIndex('num', 'FieldIndex')
+        self.zcat.addIndex('big', 'FieldIndex')
+        self.zcat.addIndex('numbers', 'KeywordIndex')
+
+        for i in range(9):
+            obj = dummy(i)
+            self.zcat.catalog_object(obj, str(i))
+
     def test_ReportLength(self):
         """ tests the report aggregation """
         self.zcat.manage_resetCatalogReport()
@@ -108,5 +143,5 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    suite.addTest(unittest.makeSuite(TestCatalogPlan))
+    suite.addTest(unittest.makeSuite(TestCatalogReport))
     return suite



More information about the Zope-Checkins mailing list