X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2bab0ca060ff224091b20a0ac808a3febaba04b1..b54ff7d7664eadf3fdf018622540d6fce835502e:/test/python/tools/conftest.py?ds=sidebyside diff --git a/test/python/tools/conftest.py b/test/python/tools/conftest.py index 60b25c3b..0098747e 100644 --- a/test/python/tools/conftest.py +++ b/test/python/tools/conftest.py @@ -7,10 +7,23 @@ import pytest @pytest.fixture -def osm2pgsql_options(temp_db): - """ A standard set of options for osm2pgsql. +def osm2pgsql_options(temp_db, tmp_path): + """ A standard set of options for osm2pgsql + together with a osm2pgsql mock that just reflects the command line. """ - return dict(osm2pgsql='echo', + osm2pgsql_exec = tmp_path / 'osm2pgsql_mock' + + osm2pgsql_exec.write_text("""#!/bin/sh + +if [ "$*" = "--version" ]; then + >&2 echo "2024-08-09 11:16:23 osm2pgsql version 11.7.2 (11.7.2)" +else + echo "$@" +fi + """) + osm2pgsql_exec.chmod(0o777) + + return dict(osm2pgsql=str(osm2pgsql_exec), osm2pgsql_cache=10, osm2pgsql_style='style.file', threads=1,