def test_standard_functions_enable_debug(db_with_tables, def_config, enabled): def_config.project_dir = Path('.') sql = _get_standard_function_sql(db_with_tables, def_config, SQL_DIR, False, enabled) assert sql assert (sql.find('--DEBUG') < 0) == enabled
def test_standard_functions_enable_diff(db_with_tables, def_config, enabled): def_config.project_dir = Path('.') sql = _get_standard_function_sql(db_with_tables, def_config, SQL_DIR, enabled, False) assert sql assert (sql.find('%DIFFUPDATES%') < 0) == enabled
def test_standard_functions_replace_module_custom(monkeypatch, db, def_config): monkeypatch.setenv('NOMINATIM_DATABASE_MODULE_PATH', 'custom') sql = _get_standard_function_sql(db, def_config, SQL_DIR, False, False) assert sql assert sql.find('{modulepath}') < 0 assert sql.find("'custom/nominatim.so'") >= 0
def test_standard_functions_replace_module_default(db, def_config): def_config.project_dir = Path('.') sql = _get_standard_function_sql(db, def_config, SQL_DIR, False, False) assert sql assert sql.find('{modulepath}') < 0 assert sql.find("'{}'".format(Path('module/nominatim.so').resolve())) >= 0
def test_standard_functions_enable_aux(monkeypatch, db_with_tables, def_config, enabled): def_config.project_dir = Path('.') monkeypatch.setenv('NOMINATIM_USE_AUX_LOCATION_DATA', 'yes' if enabled else 'no') sql = _get_standard_function_sql(db_with_tables, def_config, SQL_DIR, False, False) assert sql assert (sql.find('%NOAUXDATA%') >= 0) == enabled
def test_standard_functions_enable_limit_reindexing(monkeypatch, db_with_tables, def_config, enabled): def_config.project_dir = Path('.') monkeypatch.setenv('NOMINATIM_LIMIT_REINDEXING', 'yes' if enabled else 'no') sql = _get_standard_function_sql(db_with_tables, def_config, SQL_DIR, False, False) assert sql assert (sql.find('--LIMIT INDEXING') < 0) == enabled