#
# This file is part of Nominatim. (https://nominatim.org)
#
-# Copyright (C) 2024 by the Nominatim developer community.
+# Copyright (C) 2025 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for the deletable v1 API call.
"""
import json
import datetime as dt
-from pathlib import Path
import pytest
-import pytest_asyncio
-from fake_adaptor import FakeAdaptor, FakeError, FakeResponse
+from fake_adaptor import FakeAdaptor
import nominatim_api.v1.server_glue as glue
-import nominatim_api as napi
-
-@pytest_asyncio.fixture
-async def api():
- api = napi.NominatimAPIAsync(Path('/invalid'))
- yield api
- await api.close()
class TestPolygonsEndPoint:
errormessage text,
prevgeometry geometry(Geometry,4326),
newgeometry geometry(Geometry,4326)""",
- content=[(345, 'N', 'boundary', 'administrative',
- {'name': 'Foo'}, 'xx', self.recent,
- 'some text', None, None),
- (781, 'R', 'landuse', 'wood',
- None, 'ds', self.now,
- 'Area reduced by lots', None, None)])
-
+ content=[(345, 'N', 'boundary', 'administrative',
+ {'name': 'Foo'}, 'xx', self.recent,
+ 'some text', None, None),
+ (781, 'R', 'landuse', 'wood',
+ None, 'ds', self.now,
+ 'Area reduced by lots', None, None)])
@pytest.mark.asyncio
async def test_polygons_simple(self, api):
'errormessage': 'Area reduced by lots',
'updated': self.now.isoformat(sep=' ', timespec='seconds')}]
-
@pytest.mark.asyncio
async def test_polygons_days(self, api):
a = FakeAdaptor()
assert [r['osm_id'] for r in results] == [781]
-
@pytest.mark.asyncio
async def test_polygons_class(self, api):
a = FakeAdaptor()
assert [r['osm_id'] for r in results] == [781]
-
-
@pytest.mark.asyncio
async def test_polygons_reduced(self, api):
a = FakeAdaptor()