[Python-checkins] python/nondist/sandbox/datetime test_both.py,1.39,1.40

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月05日 16:15:31 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv10338
Modified Files:
	test_both.py 
Log Message:
Verify that fromordinal() zeroes out "extra" instance members.
Index: test_both.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_both.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** test_both.py	5 Dec 2002 23:15:59 -0000	1.39
--- test_both.py	6 Dec 2002 00:15:28 -0000	1.40
***************
*** 389,393 ****
 d = self.theclass(y, m, d)
 self.assertEqual(n, d.toordinal())
! self.assertEqual(d, self.theclass.fromordinal(n))
 
 # Check first and last days of year spottily across the whole
--- 389,401 ----
 d = self.theclass(y, m, d)
 self.assertEqual(n, d.toordinal())
! fromord = self.theclass.fromordinal(n)
! self.assertEqual(d, fromord)
! if hasattr(fromord, "hour"):
! # if we're checking something fancier than a date, verify
! # the extra fields have been zeroed out
! self.assertEqual(fromord.hour, 0)
! self.assertEqual(fromord.minute, 0)
! self.assertEqual(fromord.second, 0)
! self.assertEqual(fromord.microsecond, 0)
 
 # Check first and last days of year spottily across the whole

AltStyle によって変換されたページ (->オリジナル) /