From: Kevin Deldycke Date: Wed, 2 Mar 2016 12:01:37 +0000 (+0100) Subject: Test locale IDs uniqueness. X-Git-Tag: 2.3.1~11^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3450a6747d85ee458b0c7ab20e1f195bb3f9effe;p=thirdparty%2Fbabel.git Test locale IDs uniqueness. --- diff --git a/tests/test_localedata.py b/tests/test_localedata.py index e8e91b31..d0d92f61 100644 --- a/tests/test_localedata.py +++ b/tests/test_localedata.py @@ -81,6 +81,15 @@ def test_locale_identification(): assert localedata.exists(l) +def test_unique_ids(): + # Check all locale IDs are uniques. + all_ids = localedata.locale_identifiers() + assert len(all_ids) == len(set(all_ids)) + # Check locale IDs don't collide after lower-case normalization. + lower_case_ids = list(map(methodcaller('lower'), all_ids)) + assert len(lower_case_ids) == len(set(lower_case_ids)) + + def test_mixedcased_locale(): for l in localedata.locale_identifiers(): locale_id = ''.join([