[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateRangeIndex/tests - test_DateRangeIndex.py:1.4

Chris McDonough cvs-admin at zope.org
Tue Nov 4 09:53:30 EST 2003


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/DateRangeIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv27866/tests

Modified Files:
	test_DateRangeIndex.py 
Log Message:
Remove magical cast to int.  Raise a ValueError explicitly when we
notice that the date is a long.


=== Zope/lib/python/Products/PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py:1.3	Wed Aug 14 18:19:28 2002
+++ Zope/lib/python/Products/PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py	Tue Nov  4 09:53:29 2003
@@ -13,6 +13,7 @@
 
 import Zope
 import unittest
+import sys
 
 from Products.PluginIndexes.DateRangeIndex.DateRangeIndex import DateRangeIndex
 
@@ -111,6 +112,13 @@
             for result, match in map( None, results, matches ):
                 assert work.getEntryForObject( result ) == match.datum()
 
+    def test_longdates( self ):
+        self.assertRaises(ValueError, self._badlong )
+
+    def _badlong(self):
+        work = DateRangeIndex ('work', 'start', 'stop' )
+        bad = Dummy( 'bad', sys.maxint + 1, sys.maxint + 1 )
+        work.index_object( 0, bad )
 
 def test_suite():
     suite = unittest.TestSuite()




More information about the Zope-Checkins mailing list