mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 10:27:57 +00:00
python test: move single-use fixtures to subdirectories
This commit is contained in:
21
test/python/cli/conftest.py
Normal file
21
test/python/cli/conftest.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
|
||||
import nominatim.cli
|
||||
|
||||
@pytest.fixture
|
||||
def cli_call(src_dir):
|
||||
""" Call the nominatim main function with the correct paths set.
|
||||
Returns a function that can be called with the desired CLI arguments.
|
||||
"""
|
||||
def _call_nominatim(*args):
|
||||
return nominatim.cli.nominatim(module_dir='MODULE NOT AVAILABLE',
|
||||
osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
phplib_dir=str(src_dir / 'lib-php'),
|
||||
data_dir=str(src_dir / 'data'),
|
||||
phpcgi_path='/usr/bin/php-cgi',
|
||||
sqllib_dir=str(src_dir / 'lib-sql'),
|
||||
config_dir=str(src_dir / 'settings'),
|
||||
cli_args=args)
|
||||
|
||||
return _call_nominatim
|
||||
|
||||
Reference in New Issue
Block a user