[Python-checkins] CVS: python/nondist/sandbox/datetime test_datetime.py,1.31,1.32

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 04 Mar 2002 12:26:56 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory usw-pr-cvs1:/tmp/cvs-serv32605

Modified Files:
	test_datetime.py 
Log Message:
Add a test that fails for the current constructor of timedelta(),
because a double doesn't have enough resolution (or is that precision)
to express 10000 years in microseconds.  Tim will fix it.


Index: test_datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_datetime.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** test_datetime.py	4 Mar 2002 20:21:18 -0000	1.31
--- test_datetime.py	4 Mar 2002 20:26:54 -0000	1.32
***************
*** 393,396 ****
--- 393,402 ----
          self.assert_(datetime.max > datetime.min)
  
+     def test_extreme_timedelta(self):
+         big = datetime.max - datetime.min
+         n = (big.days*24*3600 + big.seconds)*1000000 + big.microseconds
+         justasbig = timedelta(0, 0, n)
+         self.assertEqual(big, justasbig)
+ 
  def test_suite():
      s1 = unittest.makeSuite(TestDateTime, 'test')