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

Fred L. Drake fdrake@users.sourceforge.net
Tue, 05 Mar 2002 20:37:32 -0800


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

Modified Files:
	test_datetime.py 
Log Message:
Add the test for the bit-shifting accessors here as well, just to be sure we
run all the tests the C implementation needs are also supported by the
Python implementation.


Index: test_datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_datetime.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** test_datetime.py	6 Mar 2002 01:25:15 -0000	1.38
--- test_datetime.py	6 Mar 2002 04:37:30 -0000	1.39
***************
*** 326,329 ****
--- 326,341 ----
          self.assertEqual(dt.microsecond, 0)
  
+     def test_basic_attributes_nonzero(self):
+         # Make sure all attributes are non-zero so bugs in
+         # bit-shifting access show up.
+         dt = self.theclass(2002, 3, 1, 12, 59, 59, 8000)
+         self.assertEqual(dt.year, 2002)
+         self.assertEqual(dt.month, 3)
+         self.assertEqual(dt.day, 1)
+         self.assertEqual(dt.hour, 12)
+         self.assertEqual(dt.minute, 59)
+         self.assertEqual(dt.second, 59)
+         self.assertEqual(dt.microsecond, 8000)
+ 
      def test_roundtrip(self):
          for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7),