mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 21:34:06 +00:00
extend BDD API tests to query via Python frameworks
A new config option ENGINE allows to choose between php and any of the supported Python engines.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"""
|
||||
Server implementation using the starlette webserver framework.
|
||||
"""
|
||||
from typing import Any, Type
|
||||
from typing import Any, Type, Optional, Mapping
|
||||
from pathlib import Path
|
||||
|
||||
from starlette.applications import Starlette
|
||||
@@ -67,11 +67,12 @@ V1_ROUTES = [
|
||||
Route('/status', endpoint=on_status)
|
||||
]
|
||||
|
||||
def get_application(project_dir: Path) -> Starlette:
|
||||
def get_application(project_dir: Path,
|
||||
environ: Optional[Mapping[str, str]] = None) -> Starlette:
|
||||
""" Create a Nominatim falcon ASGI application.
|
||||
"""
|
||||
app = Starlette(debug=True, routes=V1_ROUTES)
|
||||
|
||||
app.state.API = NominatimAPIAsync(project_dir)
|
||||
app.state.API = NominatimAPIAsync(project_dir, environ)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user