1616from operator import methodcaller
1717import sys
1818
19- from babel import localedata
20-
19+ from babel import localedata , numbers
2120
2221class MergeResolveTestCase (unittest .TestCase ):
2322
@@ -80,7 +79,6 @@ def test_locale_identification():
8079 for l in localedata .locale_identifiers ():
8180 assert localedata .exists (l )
8281
83-
8482def test_unique_ids ():
8583 # Check all locale IDs are uniques.
8684 all_ids = localedata .locale_identifiers ()
@@ -106,3 +104,16 @@ def test_pi_support_frozen(monkeypatch):
106104def test_pi_support_not_frozen ():
107105 assert not getattr (sys , 'frozen' , False )
108106 assert localedata .get_base_dir ().endswith ('babel' )
107+
108+ def test_locale_argument_acceptance ():
109+ # Testing None input.
110+ normalized_locale = localedata .normalize_locale (None )
111+ assert normalized_locale == None
112+ locale_exist = localedata .exists (None )
113+ assert locale_exist == False
114+
115+ # # Testing list input.
116+ normalized_locale = localedata .normalize_locale (['en_us' , None ])
117+ assert normalized_locale == None
118+ locale_exist = localedata .exists (['en_us' , None ])
119+ assert locale_exist == False
0 commit comments