X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a4e514033df5fbe3f494d757892589772a690cce..4aba70caeef6f574e59ad05972ac4981d07ea26d:/test/bdd/environment.py diff --git a/test/bdd/environment.py b/test/bdd/environment.py index f0658c33..0ac92104 100644 --- a/test/bdd/environment.py +++ b/test/bdd/environment.py @@ -5,7 +5,6 @@ import psycopg2 import psycopg2.extras import subprocess import tempfile -from nose.tools import * # for assert functions from sys import version_info as python_version logger = logging.getLogger(__name__) @@ -21,13 +20,13 @@ userconfig = { 'TEMPLATE_DB' : 'test_template_nominatim', 'TEST_DB' : 'test_nominatim', 'API_TEST_DB' : 'test_api_nominatim', - 'TEST_SETTINGS_FILE' : '/tmp/nominatim_settings.php', 'SERVER_MODULE_PATH' : None, 'PHPCOV' : False, # set to output directory to enable code coverage } use_step_matcher("re") + class NominatimEnvironment(object): """ Collects all functions for the execution of Nominatim functions. """ @@ -43,14 +42,14 @@ class NominatimEnvironment(object): self.test_db = config['TEST_DB'] self.api_test_db = config['API_TEST_DB'] self.server_module_path = config['SERVER_MODULE_PATH'] - self.local_settings_file = config['TEST_SETTINGS_FILE'] 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 - os.environ['NOMINATIM_SETTINGS'] = self.local_settings_file + self.test_env = None self.template_db_done = False + self.website_dir = None def connect_database(self, dbname): dbargs = {'database': dbname} @@ -72,24 +71,31 @@ class NominatimEnvironment(object): return fn def write_nominatim_config(self, dbname): - f = open(self.local_settings_file, 'w') - # https://secure.php.net/manual/en/ref.pdo-pgsql.connection.php - f.write("