[Python-checkins] CVS: python/dist/src/Lib/test test_calendar.py,1.1.6.1,1.1.6.2

Michael Hudson mwh@users.sourceforge.net
Mon, 25 Mar 2002 04:33:26 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv6023

Modified Files:
      Tag: release22-maint
	test_calendar.py 
Log Message:
Repeat trick with test_calendar.py



Index: test_calendar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_calendar.py,v
retrieving revision 1.1.6.1
retrieving revision 1.1.6.2
diff -C2 -d -r1.1.6.1 -r1.1.6.2
*** test_calendar.py	17 Mar 2002 18:59:32 -0000	1.1.6.1
--- test_calendar.py	25 Mar 2002 12:33:24 -0000	1.1.6.2
***************
*** 32,35 ****
--- 32,58 ----
          self.assertEqual(len([d for d in calendar.day_abbr]), 7)
  
+     def test_days(self):
+         for attr in "day_name", "day_abbr":
+             value = getattr(calendar, attr)
+             self.assertEqual(len(value), 7)
+             self.assertEqual(len(value[:]), 7)
+             # ensure they're all unique
+             d = {}
+             for v in value:
+                 d[v] = 1
+             self.assertEqual(len(d), 7)
+ 
+     def test_months(self):
+         for attr in "month_name", "month_abbr":
+             value = getattr(calendar, attr)
+             self.assertEqual(len(value), 13)
+             self.assertEqual(len(value[:]), 13)
+             self.assertEqual(value[0], "")
+             # ensure they're all unique
+             d = {}
+             for v in value:
+                 d[v] = 1
+             self.assertEqual(len(d), 13)
+ 
  def test_main():
      run_unittest(CalendarTestCase)