forked from hans/Nominatim
adapt bdd tests to new layout
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2022 by the Nominatim developer community.
|
# Copyright (C) 2024 by the Nominatim developer community.
|
||||||
# For a full list of authors see the git log.
|
# For a full list of authors see the git log.
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2022 by the Nominatim developer community.
|
# Copyright (C) 2024 by the Nominatim developer community.
|
||||||
# For a full list of authors see the git log.
|
# For a full list of authors see the git log.
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import importlib
|
import importlib
|
||||||
@@ -12,13 +12,13 @@ import tempfile
|
|||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
|
|
||||||
sys.path.insert(1, str((Path(__file__) / '..' / '..' / '..' / '..').resolve()))
|
sys.path.insert(1, str((Path(__file__) / '..' / '..' / '..' / '..'/ 'src').resolve()))
|
||||||
|
|
||||||
from nominatim import cli
|
from nominatim_db import cli
|
||||||
from nominatim.config import Configuration
|
from nominatim_core.config import Configuration
|
||||||
from nominatim.db.connection import Connection
|
from nominatim_core.db.connection import Connection
|
||||||
from nominatim.tools import refresh
|
from nominatim_db.tools import refresh
|
||||||
from nominatim.tokenizer import factory as tokenizer_factory
|
from nominatim_db.tokenizer import factory as tokenizer_factory
|
||||||
from steps.utils import run_script
|
from steps.utils import run_script
|
||||||
|
|
||||||
class NominatimEnvironment:
|
class NominatimEnvironment:
|
||||||
@@ -338,12 +338,12 @@ class NominatimEnvironment:
|
|||||||
|
|
||||||
|
|
||||||
def create_api_request_func_starlette(self):
|
def create_api_request_func_starlette(self):
|
||||||
import nominatim.server.starlette.server
|
import nominatim_api.server.starlette.server
|
||||||
from asgi_lifespan import LifespanManager
|
from asgi_lifespan import LifespanManager
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
async def _request(endpoint, params, project_dir, environ, http_headers):
|
async def _request(endpoint, params, project_dir, environ, http_headers):
|
||||||
app = nominatim.server.starlette.server.get_application(project_dir, environ)
|
app = nominatim_api.server.starlette.server.get_application(project_dir, environ)
|
||||||
|
|
||||||
async with LifespanManager(app):
|
async with LifespanManager(app):
|
||||||
async with httpx.AsyncClient(app=app, base_url="http://nominatim.test") as client:
|
async with httpx.AsyncClient(app=app, base_url="http://nominatim.test") as client:
|
||||||
@@ -356,11 +356,11 @@ class NominatimEnvironment:
|
|||||||
|
|
||||||
|
|
||||||
def create_api_request_func_falcon(self):
|
def create_api_request_func_falcon(self):
|
||||||
import nominatim.server.falcon.server
|
import nominatim_api.server.falcon.server
|
||||||
import falcon.testing
|
import falcon.testing
|
||||||
|
|
||||||
async def _request(endpoint, params, project_dir, environ, http_headers):
|
async def _request(endpoint, params, project_dir, environ, http_headers):
|
||||||
app = nominatim.server.falcon.server.get_application(project_dir, environ)
|
app = nominatim_api.server.falcon.server.get_application(project_dir, environ)
|
||||||
|
|
||||||
async with falcon.testing.ASGIConductor(app) as conductor:
|
async with falcon.testing.ASGIConductor(app) as conductor:
|
||||||
response = await conductor.get(f"/{endpoint}", params=params,
|
response = await conductor.get(f"/{endpoint}", params=params,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2022 by the Nominatim developer community.
|
# Copyright (C) 2024 by the Nominatim developer community.
|
||||||
# For a full list of authors see the git log.
|
# For a full list of authors see the git log.
|
||||||
import logging
|
import logging
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
@@ -12,8 +12,8 @@ import psycopg2.extras
|
|||||||
from place_inserter import PlaceColumn
|
from place_inserter import PlaceColumn
|
||||||
from table_compare import NominatimID, DBRow
|
from table_compare import NominatimID, DBRow
|
||||||
|
|
||||||
from nominatim.indexer import indexer
|
from nominatim_db.indexer import indexer
|
||||||
from nominatim.tokenizer import factory as tokenizer_factory
|
from nominatim_db.tokenizer import factory as tokenizer_factory
|
||||||
|
|
||||||
def check_database_integrity(context):
|
def check_database_integrity(context):
|
||||||
""" Check some generic constraints on the tables.
|
""" Check some generic constraints on the tables.
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2022 by the Nominatim developer community.
|
# Copyright (C) 2024 by the Nominatim developer community.
|
||||||
# For a full list of authors see the git log.
|
# For a full list of authors see the git log.
|
||||||
import tempfile
|
import tempfile
|
||||||
import random
|
import random
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from nominatim.tools.exec_utils import run_osm2pgsql
|
from nominatim_db.tools.exec_utils import run_osm2pgsql
|
||||||
from nominatim.tools.replication import run_osm2pgsql_updates
|
from nominatim_db.tools.replication import run_osm2pgsql_updates
|
||||||
|
|
||||||
from geometry_alias import ALIASES
|
from geometry_alias import ALIASES
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user