]> git.openstreetmap.org Git - nominatim.git/blob - test/python/cli/conftest.py
183696a97e4968b3e72f6e7257977e2bd0796672
[nominatim.git] / test / python / cli / conftest.py
1 import pytest
2
3 import nominatim.cli
4
5 @pytest.fixture
6 def cli_call(src_dir):
7     """ Call the nominatim main function with the correct paths set.
8         Returns a function that can be called with the desired CLI arguments.
9     """
10     def _call_nominatim(*args):
11         return nominatim.cli.nominatim(module_dir='MODULE NOT AVAILABLE',
12                                        osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
13                                        phplib_dir=str(src_dir / 'lib-php'),
14                                        data_dir=str(src_dir / 'data'),
15                                        phpcgi_path='/usr/bin/php-cgi',
16                                        sqllib_dir=str(src_dir / 'lib-sql'),
17                                        config_dir=str(src_dir / 'settings'),
18                                        cli_args=args)
19
20     return _call_nominatim
21