]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Increased test coverage of calendar module
authorRohit Mediratta <rohitm@gmail.com>
Sun, 1 Nov 2015 08:02:39 +0000 (01:02 -0700)
committerBart Skowron <bxsx@bartskowron.com>
Mon, 6 Jun 2022 00:29:05 +0000 (02:29 +0200)
Lib/test/test_calendar.py

index f76cbc9472a6e8fd242fe33148ea67844a1792a7..e60326e292f30a1d193df7863f39fbc5aa8ace5b 100644 (file)
@@ -546,17 +546,20 @@ class CalendarTestCase(unittest.TestCase):
         # (it is still not thread-safe though)
         old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
         try:
-            cal = calendar.LocaleTextCalendar(locale='')
+            cal = calendar.LocaleTextCalendar(locale=None)
             local_weekday = cal.formatweekday(1, 10)
+            local_weekday_abbr = cal.formatweekday(1, 3)
             local_month = cal.formatmonthname(2010, 10, 10)
         except locale.Error:
             # cannot set the system default locale -- skip rest of test
             raise unittest.SkipTest('cannot set the system default locale')
         self.assertIsInstance(local_weekday, str)
+        self.assertIsInstance(local_weekday_abbr, str)
         self.assertIsInstance(local_month, str)
         self.assertEqual(len(local_weekday), 10)
+        self.assertEqual(len(local_weekday_abbr), 3)
         self.assertGreaterEqual(len(local_month), 10)
-        cal = calendar.LocaleHTMLCalendar(locale='')
+        cal = calendar.LocaleHTMLCalendar(locale=None)
         local_weekday = cal.formatweekday(1)
         local_month = cal.formatmonthname(2010, 10)
         self.assertIsInstance(local_weekday, str)