[ZPT] CVS: Zope/lib/python/ZTUtils/tests - testBatch.py:1.4.30.1

Chris Withers chrisw@nipltd.com
Fri, 15 Mar 2002 12:45:01 -0500


Update of /cvs-repository/Zope/lib/python/ZTUtils/tests
In directory cvs.zope.org:/tmp/cvs-serv23663/tests

Modified Files:
      Tag: Zope-2_5-branch
	testBatch.py 
Log Message:
merge from head

=== Zope/lib/python/ZTUtils/tests/testBatch.py 1.4 => 1.4.30.1 ===
+import os, sys
+
+from unittest import TestCase, makeSuite, main
 
 import string
 from ZTUtils import Batch
 
-class BatchTests(unittest.TestCase):
+class BatchTests(TestCase):
 
     def testEmpty(self):
         '''Test empty Batch'''
@@ -21,6 +23,7 @@
             assert b.next is None
             assert b.start == 1, b.start
             assert len(b) ==  b.end == bsize
+            assert b.total == len(seq)
             for i in seq:
                 assert b[i] == i, (b[i], i)
                 neg = -1 - i
@@ -33,12 +36,14 @@
             assert b.next is None
             assert len(b) == bsize
             assert b[bsize - 1] == bsize - 1
+            assert b.total == bsize
         b = Batch(range(8), 5)
         assert len(b) == 5
+        assert b.total == 8
         assert len(b.next) == 3
 
 def test_suite():
-    return unittest.makeSuite(BatchTests)
+    return makeSuite(BatchTests)
 
 if __name__=='__main__':
     main()