-
-def test_lookup_placex_with_address_details(apiobj):
- apiobj.add_placex(place_id=332, osm_type='W', osm_id=4,
- class_='highway', type='residential', name='Street',
- country_code='pl',
- rank_search=27, rank_address=26)
- apiobj.add_address_placex(332, fromarea=False, isaddress=False,
- distance=0.0034,
- place_id=1000, osm_type='N', osm_id=3333,
- class_='place', type='suburb', name='Smallplace',
- country_code='pl', admin_level=13,
- rank_search=24, rank_address=23)
- apiobj.add_address_placex(332, fromarea=True, isaddress=True,
- place_id=1001, osm_type='N', osm_id=3334,
- class_='place', type='city', name='Bigplace',
- country_code='pl',
- rank_search=17, rank_address=16)
-
- result = apiobj.api.lookup(napi.PlaceID(332),
- napi.LookupDetails(address_details=True))
-
- assert result.address_rows == [
- napi.AddressLine(place_id=332, osm_object=('W', 4),
- category=('highway', 'residential'),
- names={'name': 'Street'}, extratags={},
- admin_level=15, fromarea=True, isaddress=True,
- rank_address=26, distance=0.0),
- napi.AddressLine(place_id=1000, osm_object=('N', 3333),
- category=('place', 'suburb'),
- names={'name': 'Smallplace'}, extratags={},
- admin_level=13, fromarea=False, isaddress=True,
- rank_address=23, distance=0.0034),
- napi.AddressLine(place_id=1001, osm_object=('N', 3334),
- category=('place', 'city'),
- names={'name': 'Bigplace'}, extratags={},
- admin_level=15, fromarea=True, isaddress=True,
- rank_address=16, distance=0.0),
- napi.AddressLine(place_id=None, osm_object=None,
- category=('place', 'country_code'),
- names={'ref': 'pl'}, extratags={},
- admin_level=None, fromarea=True, isaddress=False,
- rank_address=4, distance=0.0)
-
- ]
-
-
-def test_lookup_place_wth_linked_places_none_existing(apiobj):