X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/bb175cc95898de420781867973b38d033c187e81..4cc788f69e1191d2dd985aeac143597566529f24:/test/python/tools/test_refresh_create_functions.py diff --git a/test/python/tools/test_refresh_create_functions.py b/test/python/tools/test_refresh_create_functions.py index 9fddcd21..bd8724d6 100644 --- a/test/python/tools/test_refresh_create_functions.py +++ b/test/python/tools/test_refresh_create_functions.py @@ -1,9 +1,16 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2025 by the Nominatim developer community. +# For a full list of authors see the git log. """ Tests for creating PL/pgSQL functions for Nominatim. """ import pytest -from nominatim.tools.refresh import create_functions +from nominatim_db.tools.refresh import create_functions + class TestCreateFunctions: @pytest.fixture(autouse=True) @@ -12,12 +19,10 @@ class TestCreateFunctions: self.config = def_config def_config.lib_dir.sql = tmp_path - def write_functions(self, content): sqlfile = self.config.lib_dir.sql / 'functions.sql' sqlfile.write_text(content) - def test_create_functions(self, temp_db_cursor): self.write_functions("""CREATE OR REPLACE FUNCTION test() RETURNS INTEGER AS $$ @@ -31,7 +36,6 @@ class TestCreateFunctions: assert temp_db_cursor.scalar('SELECT test()') == 43 - @pytest.mark.parametrize("dbg,ret", ((True, 43), (False, 22))) def test_create_functions_with_template(self, temp_db_cursor, dbg, ret): self.write_functions("""CREATE OR REPLACE FUNCTION test() RETURNS INTEGER