]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/tokenizer/test_factory.py
Merge pull request #3523 from mtmail/import-styles-country-code
[nominatim.git] / test / python / tokenizer / test_factory.py
index 87d9b5830fcb2151fe6141a473250dbf2656e7d9..632dea88f831561fe711f26a9e535e27b6310c05 100644 (file)
@@ -1,11 +1,17 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of Nominatim. (https://nominatim.org)
+#
+# Copyright (C) 2024 by the Nominatim developer community.
+# For a full list of authors see the git log.
 """
 Tests for creating new tokenizers.
 """
 import pytest
 
 """
 Tests for creating new tokenizers.
 """
 import pytest
 
-from nominatim.db import properties
-from nominatim.tokenizer import factory
-from nominatim.errors import UsageError
+from nominatim_db.db import properties
+from nominatim_db.tokenizer import factory
+from nominatim_db.errors import UsageError
 from dummy_tokenizer import DummyTokenizer
 
 
 from dummy_tokenizer import DummyTokenizer
 
 
@@ -57,13 +63,13 @@ class TestFactory:
         assert tokenizer.init_state == "loaded"
 
 
         assert tokenizer.init_state == "loaded"
 
 
-    def test_load_no_tokenizer_dir(self):
+    def test_load_repopulate_tokenizer_dir(self):
         factory.create_tokenizer(self.config)
 
         factory.create_tokenizer(self.config)
 
-        self.config.project_dir = self.config.project_dir / 'foo'
+        self.config.project_dir = self.config.project_dir
 
 
-        with pytest.raises(UsageError):
-            factory.get_tokenizer_for_db(self.config)
+        factory.get_tokenizer_for_db(self.config)
+        assert (self.config.project_dir / 'tokenizer').exists()
 
 
     def test_load_missing_property(self, temp_db_cursor):
 
 
     def test_load_missing_property(self, temp_db_cursor):