forked from hans/Nominatim
bdd: extend osm2pgsql update tests
Now also checks for correct indexing state of placex table.
This commit is contained in:
@@ -2,60 +2,48 @@
|
||||
Feature: Update of simple objects by osm2pgsql
|
||||
Testing basic update functions of osm2pgsql.
|
||||
|
||||
Scenario: Import object with two main tags
|
||||
Scenario: Adding a new object
|
||||
When loading osm data
|
||||
"""
|
||||
n1 Ttourism=hotel,amenity=restaurant,name=foo
|
||||
n2 Tplace=locality,name=spotty
|
||||
n1 Tplace=town,name=Middletown
|
||||
"""
|
||||
Then place contains
|
||||
| object | type | name+name |
|
||||
| N1:tourism | hotel | foo |
|
||||
| N1:amenity | restaurant | foo |
|
||||
| N2:place | locality | spotty |
|
||||
When updating osm data
|
||||
"""
|
||||
n1 dV Ttourism=hotel,name=foo
|
||||
n2 dD
|
||||
"""
|
||||
Then place has no entry for N1:amenity
|
||||
And place has no entry for N2
|
||||
And place contains
|
||||
| object | class | type | name |
|
||||
| N1:tourism | tourism | hotel | 'name' : 'foo' |
|
||||
Then place contains exactly
|
||||
| object | type | name+name |
|
||||
| N1:place | town | Middletown |
|
||||
|
||||
Scenario: Downgrading a highway to one that is dropped without name
|
||||
When loading osm data
|
||||
"""
|
||||
n100 x0 y0
|
||||
n101 x0.0001 y0.0001
|
||||
w1 Thighway=residential Nn100,n101
|
||||
"""
|
||||
Then place contains
|
||||
| object |
|
||||
| W1:highway |
|
||||
When updating osm data
|
||||
"""
|
||||
w1 Thighway=service Nn100,n101
|
||||
"""
|
||||
Then place has no entry for W1
|
||||
When updating osm data
|
||||
"""
|
||||
n2 Tamenity=hotel,name=Posthotel
|
||||
"""
|
||||
Then place contains exactly
|
||||
| object | type | name+name |
|
||||
| N1:place | town | Middletown |
|
||||
| N2:amenity | hotel | Posthotel |
|
||||
And placex contains exactly
|
||||
| object | type | name+name | indexed_status |
|
||||
| N1:place | town | Middletown | 0 |
|
||||
| N2:amenity | hotel | Posthotel | 1 |
|
||||
|
||||
Scenario: Downgrading a highway when a second tag is present
|
||||
|
||||
Scenario: Deleting an existing object
|
||||
When loading osm data
|
||||
"""
|
||||
n100 x0 y0
|
||||
n101 x0.0001 y0.0001
|
||||
w1 Thighway=residential,tourism=hotel Nn100,n101
|
||||
n1 Tplace=town,name=Middletown
|
||||
n2 Tamenity=hotel,name=Posthotel
|
||||
"""
|
||||
Then place contains
|
||||
| object |
|
||||
| W1:highway |
|
||||
| W1:tourism |
|
||||
When updating osm data
|
||||
"""
|
||||
w1 Thighway=service,tourism=hotel Nn100,n101
|
||||
"""
|
||||
Then place has no entry for W1:highway
|
||||
And place contains
|
||||
| object |
|
||||
| W1:tourism |
|
||||
Then place contains exactly
|
||||
| object | type | name+name |
|
||||
| N1:place | town | Middletown |
|
||||
| N2:amenity | hotel | Posthotel |
|
||||
|
||||
When updating osm data
|
||||
"""
|
||||
n2 dD
|
||||
"""
|
||||
Then place contains exactly
|
||||
| object | type | name+name |
|
||||
| N1:place | town | Middletown |
|
||||
And placex contains exactly
|
||||
| object | type | name+name | indexed_status |
|
||||
| N1:place | town | Middletown | 0 |
|
||||
| N2:amenity | hotel | Posthotel | 100 |
|
||||
|
||||
Reference in New Issue
Block a user