forked from hans/Nominatim
simplify sql and website creation functions
This commit is contained in:
@@ -107,7 +107,8 @@ class NominatimEnvironment:
|
||||
|
||||
self.website_dir = tempfile.TemporaryDirectory()
|
||||
cfg = Configuration(None, self.src_dir / 'settings', environ=self.test_env)
|
||||
refresh.setup_website(Path(self.website_dir.name) / 'website', self.src_dir / 'lib-php', cfg)
|
||||
cfg.lib_dir.php = self.src_dir / 'lib-php'
|
||||
refresh.setup_website(Path(self.website_dir.name) / 'website', cfg)
|
||||
|
||||
def get_libpq_dsn(self):
|
||||
dsn = self.test_env['NOMINATIM_DATABASE_DSN']
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_create_functions(temp_db_cursor, conn, def_config, sql_tmp_path):
|
||||
$$ LANGUAGE plpgsql IMMUTABLE;
|
||||
""")
|
||||
|
||||
create_functions(conn, def_config, sql_tmp_path)
|
||||
create_functions(conn, def_config)
|
||||
|
||||
assert temp_db_cursor.scalar('SELECT test()') == 43
|
||||
|
||||
@@ -47,6 +47,6 @@ def test_create_functions_with_template(temp_db_cursor, conn, def_config, sql_tm
|
||||
$$ LANGUAGE plpgsql IMMUTABLE;
|
||||
""")
|
||||
|
||||
create_functions(conn, def_config, sql_tmp_path, enable_debug=dbg)
|
||||
create_functions(conn, def_config, enable_debug=dbg)
|
||||
|
||||
assert temp_db_cursor.scalar('SELECT test()') == ret
|
||||
|
||||
@@ -25,7 +25,8 @@ def test_script(envdir):
|
||||
|
||||
|
||||
def run_website_script(envdir, config):
|
||||
refresh.setup_website(envdir, envdir / 'php', config)
|
||||
config.lib_dir.php = envdir / 'php'
|
||||
refresh.setup_website(envdir, config)
|
||||
|
||||
proc = subprocess.run(['/usr/bin/env', 'php', '-Cq',
|
||||
envdir / 'search.php'], check=False)
|
||||
|
||||
Reference in New Issue
Block a user