Skip to content

Commit 9d1582c

Browse files
committed
Add a test for standalone month names and abbrs in the pl_PL locale
1 parent 833682c commit 9d1582c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

Lib/test/test_calendar.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io
99
import locale
1010
import os
11+
import platform
1112
import sys
1213
import time
1314

@@ -557,7 +558,29 @@ def test_months(self):
557558
# verify it "acts like a sequence" in two forms of iteration
558559
self.assertEqual(value[::-1], list(reversed(value)))
559560

560-
def test_standalone_month_name_and_abbr(self):
561+
@support.run_with_locale('LC_ALL', 'pl_PL')
562+
@unittest.skipUnless(sys.platform == 'darwin' or platform.libc_ver()[0] == 'glibc',
563+
"Guaranteed to work with glibc and macOS")
564+
def test_standalone_month_name_and_abbr_pl_locale(self):
565+
expected_standalone_month_names = [
566+
"", "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec",
567+
"lipiec", "sierpień", "wrzesień", "październik", "listopad",
568+
"grudzień"
569+
]
570+
expected_standalone_month_abbr = [
571+
"", "sty", "lut", "mar", "kwi", "maj", "cze",
572+
"lip", "sie", "wrz", "paź", "lis", "gru"
573+
]
574+
self.assertEqual(
575+
list(calendar.standalone_month_name),
576+
expected_standalone_month_names
577+
)
578+
self.assertEqual(
579+
list(calendar.standalone_month_abbr),
580+
expected_standalone_month_abbr
581+
)
582+
583+
def test_standalone_month_name_and_abbr_C_locale(self):
561584
# Ensure that the standalone month names and abbreviations are
562585
# equal to the regular month names and abbreviations for
563586
# the "C" locale.

0 commit comments

Comments
 (0)