X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c314a3092c5b51c7782015f6fa9ac093b46fa174..968f1cd45393015975e658fc6b70065a3bfd3c94:/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,