forked from hans/Nominatim
bdd tests: make import style configurable
The switch is for development. Tests are not guaranteed to still work when run with anything but the 'extratags' style.
This commit is contained in:
@@ -27,6 +27,7 @@ userconfig = {
|
||||
'API_TEST_FILE' : (TEST_BASE_DIR / 'testdb' / 'apidb-test-data.pbf').resolve(),
|
||||
'SERVER_MODULE_PATH' : None,
|
||||
'TOKENIZER' : None, # Test with a custom tokenizer
|
||||
'STYLE' : 'extratags',
|
||||
'PHPCOV' : False, # set to output directory to enable code coverage
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class NominatimEnvironment:
|
||||
self.api_test_db = config['API_TEST_DB']
|
||||
self.api_test_file = config['API_TEST_FILE']
|
||||
self.tokenizer = config['TOKENIZER']
|
||||
self.import_style = config['STYLE']
|
||||
self.server_module_path = config['SERVER_MODULE_PATH']
|
||||
self.reuse_template = not config['REMOVE_TEMPLATE']
|
||||
self.keep_scenario_db = config['KEEP_TEST_DB']
|
||||
@@ -107,6 +108,8 @@ class NominatimEnvironment:
|
||||
self.test_env['NOMINATIM_NOMINATIM_TOOL'] = str((self.build_dir / 'nominatim').resolve())
|
||||
if self.tokenizer is not None:
|
||||
self.test_env['NOMINATIM_TOKENIZER'] = self.tokenizer
|
||||
if self.import_style is not None:
|
||||
self.test_env['NOMINATIM_IMPORT_STYLE'] = self.import_style
|
||||
|
||||
if self.server_module_path:
|
||||
self.test_env['NOMINATIM_DATABASE_MODULE_PATH'] = self.server_module_path
|
||||
|
||||
@@ -17,7 +17,7 @@ def get_osm2pgsql_options(nominatim_env, fname, append):
|
||||
return dict(import_file=fname,
|
||||
osm2pgsql=str(nominatim_env.build_dir / 'osm2pgsql' / 'osm2pgsql'),
|
||||
osm2pgsql_cache=50,
|
||||
osm2pgsql_style=str(nominatim_env.src_dir / 'settings' / 'import-extratags.style'),
|
||||
osm2pgsql_style=str(nominatim_env.get_test_config().get_import_style_file()),
|
||||
threads=1,
|
||||
dsn=nominatim_env.get_libpq_dsn(),
|
||||
flatnode_file='',
|
||||
|
||||
Reference in New Issue
Block a user