Commit 8f06ece1 authored by Hanno Schlichting's avatar Hanno Schlichting

Document my test debt

parent f1478441
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
import unittest import unittest
from zope.testing import cleanup
class dummy(object): class dummy(object):
...@@ -26,9 +28,21 @@ class dummy(object): ...@@ -26,9 +28,21 @@ class dummy(object):
return (self.num, self.num + 1) 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): def setUp(self):
cleanup.CleanUp.setUp(self)
from Products.ZCatalog.ZCatalog import ZCatalog from Products.ZCatalog.ZCatalog import ZCatalog
self.zcat = ZCatalog('catalog') self.zcat = ZCatalog('catalog')
self.zcat.long_query_time = 0.0 self.zcat.long_query_time = 0.0
...@@ -40,9 +54,30 @@ class TestCatalogPlan(unittest.TestCase): ...@@ -40,9 +54,30 @@ class TestCatalogPlan(unittest.TestCase):
obj = dummy(i) obj = dummy(i)
self.zcat.catalog_object(obj, str(i)) self.zcat.catalog_object(obj, str(i))
def tearDown(self): # get_id
from Products.ZCatalog.plan import ValueIndexes # init_timer
ValueIndexes.clear() # 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): def test_ReportLength(self):
""" tests the report aggregation """ """ tests the report aggregation """
...@@ -108,5 +143,5 @@ class TestCatalogPlan(unittest.TestCase): ...@@ -108,5 +143,5 @@ class TestCatalogPlan(unittest.TestCase):
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCatalogPlan)) suite.addTest(unittest.makeSuite(TestCatalogReport))
return suite return suite
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment