[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/tests - testCatalog.py:1.10 framework.py:NONE

Tres Seaver tseaver@zope.com
Wed, 17 Oct 2001 16:01:05 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/tests
In directory cvs.zope.org:/tmp/cvs-serv30119/lib/python/Products/ZCatalog/tests

Modified Files:
	testCatalog.py 
Removed Files:
	framework.py 
Log Message:


  o Land unit test cleanup from branch.

  o Known breakage as of 2001/10/17:

    - TAL test suite is very broken (TAL is currently suppressed in
      lib/python/.testinfo).

    - AccessControl tests don't run if run first;  lib/python/.testinfo
      pushes them to the end of the queue, at which point they *do* run.
      Global side effects suck!

    - lib/python/BTrees/testBTreesUnicode.py:  weird flakiness around
      comparison of ASCII and Unicode strings;  breaks in different
      ways under Python 2.1 and 2.2.

    - lib/python/Products/PageTemplates/tests:  three tests break due
      to security asserctions.


=== Zope/lib/python/Products/ZCatalog/tests/testCatalog.py 1.9 => 1.10 ===
+#!/usr/bin/env python, unittest
 
 # Unittests for Catalog
 
-import os,sys
-execfile(os.path.join(sys.path[0],'framework.py'))
-os.environ['STUPID_LOG_FILE']= "debug.log"
+import os,sys, unittest
 
 import Zope
 from Products.ZCatalog import ZCatalog,Vocabulary
@@ -324,7 +322,8 @@
 class testRS(unittest.TestCase):
 
     def setUp(self):
-        self._vocabulary = Vocabulary.Vocabulary('Vocabulary','Vocabulary', globbing=1)
+        self._vocabulary = Vocabulary.Vocabulary('Vocabulary','Vocabulary'
+                                                , globbing=1)
         self._catalog    = Catalog()
         index = FieldIndex('number')
         self._catalog.addIndex('number',  index)
@@ -342,11 +341,25 @@
             m = whrandom.randint(0,20000) 
             n = m + 1000
 
-            for r  in self._catalog.searchResults( {"number" : (m,n) ,
-                                                    "length_usage" : "range:min:max" } 
-                                            ):
+            for r  in self._catalog.searchResults(
+                { "number" : (m,n) ,
+                  "length_usage" : "range:min:max" } ):
                 size = r.number
                 assert m<=size and size<=n , "%d vs [%d,%d]" % (r.number,m,n)
 
 
-framework()
+
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest( unittest.makeSuite( TestAddDelColumn ) )
+    suite.addTest( unittest.makeSuite( TestAddDelIndexes ) )
+    suite.addTest( unittest.makeSuite( TestZCatalogObject ) )
+    suite.addTest( unittest.makeSuite( TestCatalogObject ) )
+    suite.addTest( unittest.makeSuite( testRS ) )
+    return suite
+
+def main():
+    unittest.TextTestRunner().run(test_suite())
+
+if __name__ == '__main__':
+    main()

=== Removed File Zope/lib/python/Products/ZCatalog/tests/framework.py ===