]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-69714: Restore the test thrown out by cb0523e67c
authorBart Skowron <bxsx@bartskowron.com>
Mon, 6 Jun 2022 21:24:26 +0000 (23:24 +0200)
committerBart Skowron <bxsx@bartskowron.com>
Mon, 6 Jun 2022 21:24:26 +0000 (23:24 +0200)
Lib/test/test_calendar.py

index e60326e292f30a1d193df7863f39fbc5aa8ace5b..07126a2bf4deb33a365c05b71ef29119eec32fe3 100644 (file)
@@ -559,11 +559,27 @@ class CalendarTestCase(unittest.TestCase):
         self.assertEqual(len(local_weekday), 10)
         self.assertEqual(len(local_weekday_abbr), 3)
         self.assertGreaterEqual(len(local_month), 10)
+
+        cal = calendar.LocaleTextCalendar(locale='')
+        local_weekday = cal.formatweekday(1, 10)
+        local_month = cal.formatmonthname(2010, 10, 10)
+        self.assertIsInstance(local_weekday, str)
+        self.assertIsInstance(local_month, str)
+        self.assertEqual(len(local_weekday), 10)
+        self.assertGreaterEqual(len(local_month), 10)
+
         cal = calendar.LocaleHTMLCalendar(locale=None)
         local_weekday = cal.formatweekday(1)
         local_month = cal.formatmonthname(2010, 10)
         self.assertIsInstance(local_weekday, str)
         self.assertIsInstance(local_month, str)
+
+        cal = calendar.LocaleHTMLCalendar(locale='')
+        local_weekday = cal.formatweekday(1)
+        local_month = cal.formatmonthname(2010, 10)
+        self.assertIsInstance(local_weekday, str)
+        self.assertIsInstance(local_month, str)
+
         new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
         self.assertEqual(old_october, new_october)