From d6e607fa38908f8beeff0e892a0d25af74f8a4f2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 Dec 2023 13:51:40 +1000 Subject: rules: fix iso639 codes after removals https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3_Retirements.tab ais Nataoran Amis S Split by part going to Amis [ami] and creating Sakizaya [szy] with the remaining part 2019-01-25 uun Kulon-Pazeh S Split into Kulon [uon] and Pazeh [pzh] 2022-01-20 See also the pycountry commit https://github.com/pycountry/pycountry/commit/a2341a11df5b5fddb26519e9b9cbe1befdee74a9 Fixes #430 --- rules/base.xml | 5 +++-- tests/test_rules_xml.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/rules/base.xml b/rules/base.xml index 4e18bd12..ad4df7c8 100644 --- a/rules/base.xml +++ b/rules/base.xml @@ -6508,15 +6508,16 @@ ckv pwn pyu + pzh dru - ais ssf + szy tao tsu trv xnb sxr - uun + uon fos diff --git a/tests/test_rules_xml.py b/tests/test_rules_xml.py index cd0df4f8..6541d17a 100644 --- a/tests/test_rules_xml.py +++ b/tests/test_rules_xml.py @@ -266,9 +266,16 @@ def test_iso639(layout): expected_without_language = ["brai", "custom", "trans"] for code in layout.iso639: - assert ( - code in language_codes - ), f'{layout.rulesfile}: unknown language code "{code}" in {layout.name}' + try: + assert ( + code in language_codes + ), f'{layout.rulesfile}: unknown language code "{code}" in {layout.name}' + except AssertionError as e: + # needs pycountry 23.12.7, this code can be removed when our CI has pycountry new enough + if code in ["pzh", "szy", "uon"]: + pytest.skip("pycountry too old, skipping") + else: + raise e assert ( layout.iso639 or layout.layout.name in expected_without_language -- cgit v1.2.3