[Zope-Checkins] SVN: Zope/trunk/src/Products/ZCatalog/tests/test_catalog.py Move test helper classes to the top of the module, more meaningful name for TestRS

Hanno Schlichting hannosch at hannosch.eu
Sun Aug 1 08:29:03 EDT 2010


Log message for revision 115318:
  Move test helper classes to the top of the module, more meaningful name for TestRS
  

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

-=-
Modified: Zope/trunk/src/Products/ZCatalog/tests/test_catalog.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/tests/test_catalog.py	2010-08-01 12:15:22 UTC (rev 115317)
+++ Zope/trunk/src/Products/ZCatalog/tests/test_catalog.py	2010-08-01 12:29:02 UTC (rev 115318)
@@ -55,6 +55,39 @@
     return L
 
 
+class zdummy(ExtensionClass.Base):
+    def __init__(self, num):
+        self.num = num
+
+    def title(self):
+        return '%d' % self.num
+
+
+class dummy(ExtensionClass.Base):
+
+    att1 = 'att1'
+    att2 = 'att2'
+    att3 = ['att3']
+
+    def __init__(self, num):
+        self.num = num
+
+    def col1(self):
+        return 'col1'
+
+    def col2(self):
+        return 'col2'
+
+    def col3(self):
+        return ['col3']
+
+
+class objRS(ExtensionClass.Base):
+
+    def __init__(self, num):
+        self.number = num
+
+
 class CatalogBase:
 
     def setUp(self):
@@ -129,33 +162,6 @@
                      'del index failed')
 
 
-class zdummy(ExtensionClass.Base):
-    def __init__(self, num):
-        self.num = num
-
-    def title(self):
-        return '%d' % self.num
-
-
-class dummy(ExtensionClass.Base):
-
-    att1 = 'att1'
-    att2 = 'att2'
-    att3 = ['att3']
-
-    def __init__(self, num):
-        self.num = num
-
-    def col1(self):
-        return 'col1'
-
-    def col2(self):
-        return 'col2'
-
-    def col3(self):
-        return ['col3']
-
-
 class TestCatalogObject(unittest.TestCase):
 
     upper = 1000
@@ -391,14 +397,8 @@
         self.assertEqual(brain.att1, 'foobar')
 
 
-class objRS(ExtensionClass.Base):
+class TestRangeSearch(unittest.TestCase):
 
-    def __init__(self, num):
-        self.number = num
-
-
-class TestRS(unittest.TestCase):
-
     def setUp(self):
         self._catalog = Catalog()
         index = FieldIndex('number')
@@ -518,6 +518,6 @@
     suite.addTest(unittest.makeSuite(TestAddDelColumn))
     suite.addTest(unittest.makeSuite(TestAddDelIndexes))
     suite.addTest(unittest.makeSuite(TestCatalogObject))
-    suite.addTest(unittest.makeSuite(TestRS))
+    suite.addTest(unittest.makeSuite(TestRangeSearch))
     suite.addTest(unittest.makeSuite(TestMerge))
     return suite



More information about the Zope-Checkins mailing list