]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/config/test_config_load_module.py
also enable flake for tests in github actions
[nominatim.git] / test / python / config / test_config_load_module.py
index cee88c825241f86694ebfe11ee7106ca8078061a..309bd1fc325850c1be2bf5254a5557a49d5bcf5b 100644 (file)
@@ -1,18 +1,18 @@
-# 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) 2025 by the Nominatim developer community.
 # For a full list of authors see the git log.
 """
 Test for loading extra Python modules.
 """
-from pathlib import Path
 import sys
 
 import pytest
 
-from nominatim.config import Configuration
+from nominatim_db.config import Configuration
+
 
 @pytest.fixture
 def test_config(src_dir, tmp_path):
@@ -21,17 +21,23 @@ def test_config(src_dir, tmp_path):
     """
     (tmp_path / 'project').mkdir()
     (tmp_path / 'config').mkdir()
-    conf = Configuration(tmp_path / 'project', src_dir / 'settings')
+    conf = Configuration(tmp_path / 'project')
     conf.config_dir = tmp_path / 'config'
     return conf
 
 
 def test_load_default_module(test_config):
-    module = test_config.load_plugin_module('version', 'nominatim')
+    module = test_config.load_plugin_module('version', 'nominatim_db')
 
     assert isinstance(module.NOMINATIM_VERSION, tuple)
 
 
+def test_load_default_module_with_hyphen(test_config):
+    module = test_config.load_plugin_module('place-info', 'nominatim_db.data')
+
+    assert isinstance(module.PlaceInfo, object)
+
+
 def test_load_plugin_module(test_config, tmp_path):
     (tmp_path / 'project' / 'testpath').mkdir()
     (tmp_path / 'project' / 'testpath' / 'mymod.py')\