From: Tareq Al-Ahdal Date: Fri, 1 Apr 2022 13:58:57 +0000 (+0800) Subject: test for loading special characters from country_settings.yaml X-Git-Tag: v4.1.0~64^2~3 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/a323b8f63a42952ff5ebbb49e92faceaa9a01798 test for loading special characters from country_settings.yaml --- diff --git a/test/python/tools/test_country_info.py b/test/python/tools/test_country_info.py index 2651ebd3..3c3a1acb 100644 --- a/test/python/tools/test_country_info.py +++ b/test/python/tools/test_country_info.py @@ -100,3 +100,18 @@ de: country_info.setup_country_config(project_env) assert country_info._COUNTRY_INFO._info == {'de': {'partition': 3, 'languages': ['de'], 'names': {'name': {}}}} + +@pytest.mark.custom_country_config +def test_setup_country_config_special_character(project_env): + (project_env.project_dir / 'country_settings.yaml').write_text(""" +bq: + partition: 250 + languages: nl + names: + name: + default: "\\N" +""") + country_info._COUNTRY_INFO._info = None + country_info.setup_country_config(project_env) + assert country_info._COUNTRY_INFO._info == {'bq': {'partition': 250, + 'languages': ['nl'], 'names': {'name': {'default': '\x85'}}}}