summaryrefslogtreecommitdiff
path: root/Lib/test/test_calendar.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-03-23 03:26:53 +0000
committerTim Peters <tim.peters@gmail.com>2002-03-23 03:26:53 +0000
commit0c2c8e77fba38a68554b264a2985000d3006d8d1 (patch)
tree0f9894a98f8b723e0951e8f845d3232776436ecf /Lib/test/test_calendar.py
parented19b88f0b203bea32c9193009143e71f40f355f (diff)
downloadcpython-git-0c2c8e77fba38a68554b264a2985000d3006d8d1.tar.gz
SF bug 533234: tm_isdst > 1 Passed to strftime.
One more time on this turkey, but duller instead of cleverer. Curious: The docs say __getslice__ has been deprecated since 2.0, but list.__getitem__ still doesn't work if you pass it a slice. This makes it a lot clearer to emulate a list by *being* a list <wink>. Bugfix candidate. Michael, just pile this patch on top of the others that went by -- no need to try to pick these apart.
Diffstat (limited to 'Lib/test/test_calendar.py')
-rw-r--r--Lib/test/test_calendar.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index eed96efa93..2059eaf355 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -31,6 +31,29 @@ class CalendarTestCase(unittest.TestCase):
self.assertRaises(IndexError, calendar.day_name.__getitem__, 10)
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)