assert result.importance == pytest.approx(0.01)
assert result.country_code == 'gb'
- assert result.indexed_date == import_date
+ assert result.indexed_date == import_date.replace(tzinfo=dt.timezone.utc)
assert result.address_rows is None
assert result.linked_rows is None
assert result.importance is None
assert result.country_code is None
- assert result.indexed_date == import_date
+ assert result.indexed_date == import_date.replace(tzinfo=dt.timezone.utc)
assert result.address_rows is None
assert result.linked_rows is None
assert result.importance is None
assert result.country_code == 'gb'
- assert result.indexed_date == import_date
+ assert result.indexed_date == import_date.replace(tzinfo=dt.timezone.utc)
assert result.address_rows is None
assert result.linked_rows is None
startnumber=1, endnumber=4, step=1,
postcode='34425',
geometry='LINESTRING(23 34, 23 35)')
+ apiobj.add_placex(place_id=12,
+ category=('highway', 'residential'),
+ osm_type='W', osm_id=6601223,
+ geometry='LINESTRING(23 34, 23 35)')
result = apiobj.api.lookup(napi.PlaceID(4924), napi.LookupDetails())
assert result.place_id == 4924
assert result.parent_place_id == 12
assert result.linked_place_id is None
- assert result.osm_object is None
+ assert result.osm_object == ('W', 6601223)
assert result.admin_level == 15
assert result.names is None
assert result.importance is None
assert result.country_code == 'gb'
- assert result.indexed_date == import_date
+ assert result.indexed_date == import_date.replace(tzinfo=dt.timezone.utc)
assert result.address_rows is None
assert result.linked_rows is None
rank_address=4, distance=0.0)
]
+@pytest.mark.parametrize('objid', [napi.PlaceID(1736),
+ napi.OsmID('W', 55),
+ napi.OsmID('N', 55, 'amenity')])
+def test_lookup_missing_object(apiobj, objid):
+ apiobj.add_placex(place_id=1, osm_type='N', osm_id=55,
+ class_='place', type='suburb')
+
+ assert apiobj.api.lookup(objid, napi.LookupDetails()) is None
+
@pytest.mark.parametrize('gtype', (napi.GeometryFormat.KML,
napi.GeometryFormat.SVG,