X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/474aea61da51df47cfb5b3cc8f4fdff9b0cf23fc..7ba5152493327d277115aab9b344b652decd3f2e:/test/bdd/steps/nominatim_environment.py diff --git a/test/bdd/steps/nominatim_environment.py b/test/bdd/steps/nominatim_environment.py index 88a4f11c..9836865c 100644 --- a/test/bdd/steps/nominatim_environment.py +++ b/test/bdd/steps/nominatim_environment.py @@ -37,8 +37,6 @@ class NominatimEnvironment: self.server_module_path = config['SERVER_MODULE_PATH'] self.reuse_template = not config['REMOVE_TEMPLATE'] self.keep_scenario_db = config['KEEP_TEST_DB'] - self.code_coverage_path = config['PHPCOV'] - self.code_coverage_id = 1 self.default_config = Configuration(None).get_os_env() self.test_env = None @@ -46,11 +44,9 @@ class NominatimEnvironment: self.api_db_done = False self.website_dir = None - self.api_engine = None - if config['API_ENGINE'] != 'php': - if not hasattr(self, f"create_api_request_func_{config['API_ENGINE']}"): - raise RuntimeError(f"Unknown API engine '{config['API_ENGINE']}'") - self.api_engine = getattr(self, f"create_api_request_func_{config['API_ENGINE']}")() + if not hasattr(self, f"create_api_request_func_{config['API_ENGINE']}"): + raise RuntimeError(f"Unknown API engine '{config['API_ENGINE']}'") + self.api_engine = getattr(self, f"create_api_request_func_{config['API_ENGINE']}")() if self.tokenizer == 'legacy' and self.server_module_path is None: raise RuntimeError("You must set -DSERVER_MODULE_PATH when testing the legacy tokenizer.") @@ -70,13 +66,6 @@ class NominatimEnvironment: dbargs['password'] = self.db_pass return psycopg.connect(**dbargs) - def next_code_coverage_file(self): - """ Generate the next name for a coverage file. - """ - fn = Path(self.code_coverage_path) / "{:06d}.cov".format(self.code_coverage_id) - self.code_coverage_id += 1 - - return fn.resolve() def write_nominatim_config(self, dbname): """ Set up a custom test configuration that connects to the given @@ -119,15 +108,6 @@ class NominatimEnvironment: self.website_dir = tempfile.TemporaryDirectory() - try: - conn = self.connect_database(dbname) - except: - conn = False - refresh.setup_website(Path(self.website_dir.name) / 'website', - self.get_test_config(), conn) - if conn: - conn.close() - def get_test_config(self): cfg = Configuration(Path(self.website_dir.name), environ=self.test_env)