X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/af52eed0dda746f2a495cd6e33e777c43c04d0b3..f3c4196c758a7720aefc26a7043bf1c6553028e2:/test/python/test_tools_exec_utils.py diff --git a/test/python/test_tools_exec_utils.py b/test/python/test_tools_exec_utils.py index e713300e..25ccf163 100644 --- a/test/python/test_tools_exec_utils.py +++ b/test/python/test_tools_exec_utils.py @@ -52,41 +52,45 @@ class TestRunLegacyScript: def test_run_legacy_return_dont_throw_on_success(self): fname = self.mk_script('exit(0);') - assert 0 == exec_utils.run_legacy_script(fname, nominatim_env=self.testenv, - throw_on_fail=True) + assert exec_utils.run_legacy_script(fname, nominatim_env=self.testenv, + throw_on_fail=True) == 0 def test_run_legacy_use_given_module_path(self): fname = self.mk_script("exit($_SERVER['NOMINATIM_DATABASE_MODULE_PATH'] == '' ? 0 : 23);") - assert 0 == exec_utils.run_legacy_script(fname, nominatim_env=self.testenv) + assert exec_utils.run_legacy_script(fname, nominatim_env=self.testenv) == 0 def test_run_legacy_do_not_overwrite_module_path(self, monkeypatch): monkeypatch.setenv('NOMINATIM_DATABASE_MODULE_PATH', 'other') - fname = self.mk_script("exit($_SERVER['NOMINATIM_DATABASE_MODULE_PATH'] == 'other' ? 0 : 1);") + fname = self.mk_script( + "exit($_SERVER['NOMINATIM_DATABASE_MODULE_PATH'] == 'other' ? 0 : 1);") - assert 0 == exec_utils.run_legacy_script(fname, nominatim_env=self.testenv) + assert exec_utils.run_legacy_script(fname, nominatim_env=self.testenv) == 0 class TestRunApiScript: + @staticmethod @pytest.fixture(autouse=True) - def setup_project_dir(self, tmp_path): + def setup_project_dir(tmp_path): webdir = tmp_path / 'website' webdir.mkdir() (webdir / 'test.php').write_text("