X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cce0e5ea38fe3466e157651e789554d99fbdc8fe..0add25e33500110a36458a0bb3fa292d408d2b85:/test/python/tools/test_sp_csv_loader.py diff --git a/test/python/tools/test_sp_csv_loader.py b/test/python/tools/test_sp_csv_loader.py index b5069a52..9d0ad9cc 100644 --- a/test/python/tools/test_sp_csv_loader.py +++ b/test/python/tools/test_sp_csv_loader.py @@ -1,16 +1,17 @@ -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2022 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ Tests for methods of the SPCsvLoader class. """ import pytest -from nominatim.errors import UsageError -from nominatim.tools.special_phrases.sp_csv_loader import SPCsvLoader +from nominatim_db.errors import UsageError +from nominatim_db.tools.special_phrases.sp_csv_loader import SPCsvLoader +from nominatim_db.tools.special_phrases.special_phrase import SpecialPhrase @pytest.fixture def sp_csv_loader(src_dir): @@ -29,17 +30,11 @@ def test_generate_phrases(sp_csv_loader): """ phrases = list(sp_csv_loader.generate_phrases()) - assert len(phrases) == 41 + assert len(phrases) == 42 assert len(set(phrases)) == 41 - assert any(p.p_label == 'Billboard' - and p.p_class == 'advertising' - and p.p_type == 'billboard' - and p.p_operator == '-' for p in phrases) - assert any(p.p_label == 'Zip Lines' - and p.p_class == 'aerialway' - and p.p_type == 'zip_line' - and p.p_operator == '-' for p in phrases) + assert SpecialPhrase('Billboard', 'advertising', 'billboard', '-') in phrases + assert SpecialPhrase('Zip Lines', 'aerialway', 'zip_line', '-') in phrases def test_invalid_cvs_file():