From: Sarah Hoffmann Date: Tue, 30 Mar 2021 07:19:01 +0000 (+0200) Subject: Merge pull request #2243 from darkshredder/XML-format-fix X-Git-Tag: v3.7.0~6 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/8dbfdd59b0a209d3785a0e07004d8ca8e80e45d4?hp=0b154a2a1af98a32f66af6ef7c81611628bb78e1 Merge pull request #2243 from darkshredder/XML-format-fix Fixed: XML format: more_url points to localhost, not base URL --- diff --git a/test/python/test_tools_import_special_phrases.py b/test/python/test_tools_import_special_phrases.py index 7a8b832d..b77ae10d 100644 --- a/test/python/test_tools_import_special_phrases.py +++ b/test/python/test_tools_import_special_phrases.py @@ -17,16 +17,14 @@ def test_check_sanity_class(special_phrases_importer): If a wrong class or type is given, an UsageError should raise. If a good class and type are given, nothing special happens. """ - with pytest.raises(UsageError) as wrong_class: + with pytest.raises(UsageError): special_phrases_importer._check_sanity('en', '', 'type') - with pytest.raises(UsageError) as wrong_type: + with pytest.raises(UsageError): special_phrases_importer._check_sanity('en', 'class', '') special_phrases_importer._check_sanity('en', 'class', 'type') - assert wrong_class and wrong_type - def test_load_white_and_black_lists(special_phrases_importer): """ Test that _load_white_and_black_lists() well return @@ -55,12 +53,9 @@ def test_convert_settings_wrong_file(special_phrases_importer): Test that _convert_php_settings_if_needed() raise an exception if the given file is not a valid file. """ - - with pytest.raises(UsageError) as exceptioninfos: + with pytest.raises(UsageError, match='random_file is not a valid file.'): special_phrases_importer._convert_php_settings_if_needed('random_file') - assert str(exceptioninfos.value) == 'random_file is not a valid file.' - def test_convert_settings_json_already_exist(special_phrases_importer): """ Test that if we give to '_convert_php_settings_if_needed' a php file path @@ -78,7 +73,7 @@ def test_convert_settings_giving_json(special_phrases_importer): Test that if we give to '_convert_php_settings_if_needed' a json file path the same path is directly returned """ - json_file = (TEST_BASE_DIR / 'testfiles' / 'phrase-settings.json').resolve() + json_file = (TEST_BASE_DIR / 'testfiles' / 'phrase_settings.json').resolve() returned = special_phrases_importer._convert_php_settings_if_needed(json_file) diff --git a/test/testfiles/phrase-settings.json b/test/testfiles/phrase_settings.json similarity index 100% rename from test/testfiles/phrase-settings.json rename to test/testfiles/phrase_settings.json