bdd: move update tests from scenes to grid descriptions

This commit is contained in:
Sarah Hoffmann
2022-06-16 21:56:39 +02:00
parent 02068aec7f
commit 00d8df6fc3
8 changed files with 277 additions and 182 deletions

View File

@@ -2,41 +2,47 @@
Feature: Country handling Feature: Country handling
Tests for update of country information Tests for update of country information
Background:
Given the 1.0 grid with origin DE
| 1 | | 2 |
| | 10 | |
| 4 | | 3 |
@fail-legacy @fail-legacy
Scenario: When country names are changed old ones are no longer searchable Scenario: When country names are changed old ones are no longer searchable
Given the places Given the places
| osm | class | type | admin | name+name:xy | country | geometry | | osm | class | type | admin | name+name:xy | country | geometry |
| R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | town | Wenig | country:de | | N10 | place | town | Wenig |
When importing When importing
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
Then results contain Then results contain
| osm | | osm |
| N1 | | N10 |
When updating places When updating places
| osm | class | type | admin | name+name:xy | country | geometry | | osm | class | type | admin | name+name:xy | country | geometry |
| R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
Then exactly 0 results are returned Then exactly 0 results are returned
@fail-legacy @fail-legacy
Scenario: When country names are deleted they are no longer searchable Scenario: When country names are deleted they are no longer searchable
Given the places Given the places
| osm | class | type | admin | name+name:xy | country | geometry | | osm | class | type | admin | name+name:xy | country | geometry |
| R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | town | Wenig | country:de | | N10 | place | town | Wenig |
When importing When importing
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
Then results contain Then results contain
| osm | | osm |
| N1 | | N10 |
When updating places When updating places
| osm | class | type | admin | name+name:en | country | geometry | | osm | class | type | admin | name+name:en | country | geometry |
| R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
Then exactly 0 results are returned Then exactly 0 results are returned
When sending search query "Wenig" When sending search query "Wenig"
@@ -44,57 +50,57 @@ Feature: Country handling
| xy,en | | xy,en |
Then results contain Then results contain
| osm | display_name | | osm | display_name |
| N1 | Wenig, Germany | | N10 | Wenig, Germany |
Scenario: Default country names are always searchable Scenario: Default country names are always searchable
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | town | Wenig | country:de | | N10 | place | town | Wenig |
When importing When importing
When sending search query "Wenig, Germany" When sending search query "Wenig, Germany"
Then results contain Then results contain
| osm | | osm |
| N1 | | N10 |
When sending search query "Wenig, de" When sending search query "Wenig, de"
Then results contain Then results contain
| osm | | osm |
| N1 | | N10 |
When updating places When updating places
| osm | class | type | admin | name+name:en | country | geometry | | osm | class | type | admin | name+name:en | country | geometry |
| R1 | boundary | administrative | 2 | Lilly | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Lilly | de | (1,2,3,4,1) |
When sending search query "Wenig, Germany" When sending search query "Wenig, Germany"
| accept-language | | accept-language |
| en,de | | en,de |
Then results contain Then results contain
| osm | display_name | | osm | display_name |
| N1 | Wenig, Lilly | | N10 | Wenig, Lilly |
When sending search query "Wenig, de" When sending search query "Wenig, de"
| accept-language | | accept-language |
| en,de | | en,de |
Then results contain Then results contain
| osm | display_name | | osm | display_name |
| N1 | Wenig, Lilly | | N10 | Wenig, Lilly |
@fail-legacy @fail-legacy
Scenario: When a localised name is deleted, the standard name takes over Scenario: When a localised name is deleted, the standard name takes over
Given the places Given the places
| osm | class | type | admin | name+name:de | country | geometry | | osm | class | type | admin | name+name:de | country | geometry |
| R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | town | Wenig | country:de | | N10 | place | town | Wenig |
When importing When importing
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
| accept-language | | accept-language |
| de,en | | de,en |
Then results contain Then results contain
| osm | display_name | | osm | display_name |
| N1 | Wenig, Loudou | | N10 | Wenig, Loudou |
When updating places When updating places
| osm | class | type | admin | name+name:en | country | geometry | | osm | class | type | admin | name+name:en | country | geometry |
| R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) | | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou" When sending search query "Wenig, Loudou"
Then exactly 0 results are returned Then exactly 0 results are returned
When sending search query "Wenig" When sending search query "Wenig"
@@ -102,5 +108,5 @@ Feature: Country handling
| de,en | | de,en |
Then results contain Then results contain
| osm | display_name | | osm | display_name |
| N1 | Wenig, Deutschland | | N10 | Wenig, Deutschland |

View File

@@ -3,47 +3,55 @@ Feature: Update of address interpolations
Test the interpolated address are updated correctly Test the interpolated address are updated correctly
Scenario: new interpolation added to existing street Scenario: new interpolation added to existing street
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | 99 | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then W10 expands to no interpolation Then W10 expands to no interpolation
When updating places When updating places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And updating places And updating places
| osm | class | type | addr+interpolation | geometry | | osm | class | type | addr+interpolation | geometry |
| W10 | place | houses | even | :w-middle | | W10 | place | houses | even | 1,2 |
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| N1 | W2 | | N1 | W2 |
| N2 | W2 | | N2 | W2 |
And W10 expands to interpolation And W10 expands to interpolation
| parent_place_id | start | end | | parent_place_id | start | end | geometry |
| W2 | 4 | 4 | | W2 | 4 | 4 | 99 |
Scenario: addr:street added to interpolation Scenario: addr:street added to interpolation
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | addr+interpolation | geometry | | osm | class | type | addr+interpolation | geometry |
| W10 | place | houses | even | :w-middle | | W10 | place | houses | even | 1,2 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
@@ -54,7 +62,7 @@ Feature: Update of address interpolations
| W2 | 4 | 4 | | W2 | 4 | 4 |
When updating places When updating places
| osm | class | type | addr+interpolation | street | geometry | | osm | class | type | addr+interpolation | street | geometry |
| W10 | place | houses | even | Cloud Street | :w-middle | | W10 | place | houses | even | Cloud Street | 1,2 |
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| N1 | W3 | | N1 | W3 |
@@ -64,21 +72,25 @@ Feature: Update of address interpolations
| W3 | 4 | 4 | | W3 | 4 | 4 |
Scenario: addr:street added to housenumbers Scenario: addr:street added to housenumbers
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | addr+interpolation | geometry | | osm | class | type | addr+interpolation | geometry |
| W10 | place | houses | even | :w-middle | | W10 | place | houses | even | 1,2 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
@@ -88,9 +100,9 @@ Feature: Update of address interpolations
| parent_place_id | start | end | | parent_place_id | start | end |
| W2 | 4 | 4 | | W2 | 4 | 4 |
When updating places When updating places
| osm | class | type | street | housenr | geometry | | osm | class | type | street | housenr |
| N1 | place | house | Cloud Street| 2 | :n-middle-w | | N1 | place | house | Cloud Street| 2 |
| N2 | place | house | Cloud Street| 6 | :n-middle-e | | N2 | place | house | Cloud Street| 6 |
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| N1 | W3 | | N1 | W3 |
@@ -100,21 +112,25 @@ Feature: Update of address interpolations
| W3 | 4 | 4 | | W3 | 4 | 4 |
Scenario: interpolation tag removed Scenario: interpolation tag removed
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | addr+interpolation | geometry | | osm | class | type | addr+interpolation | geometry |
| W10 | place | houses | even | :w-middle | | W10 | place | houses | even | 1,2 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
@@ -131,20 +147,24 @@ Feature: Update of address interpolations
| N2 | W2 | | N2 | W2 |
Scenario: referenced road added Scenario: referenced road added
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | addr+interpolation | street | geometry | | osm | class | type | addr+interpolation | street | geometry |
| W10 | place | houses | even | Cloud Street| :w-middle | | W10 | place | houses | even | Cloud Street| 1,2 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
@@ -155,7 +175,7 @@ Feature: Update of address interpolations
| W2 | 4 | 4 | | W2 | 4 | 4 |
When updating places When updating places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| N1 | W3 | | N1 | W3 |
@@ -165,21 +185,25 @@ Feature: Update of address interpolations
| W3 | 4 | 4 | | W3 | 4 | 4 |
Scenario: referenced road deleted Scenario: referenced road deleted
Given the scene parallel-road Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | | | | |
| 20 | | | | 21 |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-middle-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-middle-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | addr+interpolation | street | geometry | | osm | class | type | addr+interpolation | street | geometry |
| W10 | place | houses | even | Cloud Street| :w-middle | | W10 | place | houses | even | Cloud Street| 1,2 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Sun Way | :w-north | | W2 | highway | unclassified | Sun Way | 10,11 |
| W3 | highway | unclassified | Cloud Street | :w-south | | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways And the ways
| id | nodes | | id | nodes |
| 10 | 1,100,101,102,2 | | 10 | 1,2 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
@@ -198,79 +222,85 @@ Feature: Update of address interpolations
| W2 | 4 | 4 | | W2 | 4 | 4 |
Scenario: building becomes interpolation Scenario: building becomes interpolation
Given the scene building-with-parallel-streets Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | 4 | | 3 | |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr | geometry |
| W1 | place | house | 3 | :w-building | | W1 | place | house | 3 | (1,2,3,4,1) |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Cloud Street | :w-south | | W2 | highway | unclassified | Cloud Street | 10,11 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| W1 | W2 | | W1 | W2 |
Given the ways Given the ways
| id | nodes | | id | nodes |
| 1 | 1,100,101,102,2 | | 1 | 1,2 |
When updating places When updating places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-north-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-north-e | | N2 | place | house | 6 |
And updating places And updating places
| osm | class | type | addr+interpolation | street | geometry | | osm | class | type | addr+interpolation | street | geometry |
| W1 | place | houses | even | Cloud Street| :w-north | | W1 | place | houses | even | Cloud Street| 1,2 |
Then placex has no entry for W1 Then placex has no entry for W1
And W1 expands to interpolation And W1 expands to interpolation
| parent_place_id | start | end | | parent_place_id | start | end |
| W2 | 4 | 4 | | W2 | 4 | 4 |
Scenario: interpolation becomes building Scenario: interpolation becomes building
Given the scene building-with-parallel-streets Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
| | 4 | | 3 | |
And the places And the places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-north-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-north-e | | N2 | place | house | 6 |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Cloud Street | :w-south | | W2 | highway | unclassified | Cloud Street | 10,11 |
And the ways And the ways
| id | nodes | | id | nodes |
| 1 | 1,100,101,102,2 | | 1 | 1,2 |
And the places And the places
| osm | class | type | addr+interpolation | street | geometry | | osm | class | type | addr+interpolation | street | geometry |
| W1 | place | houses | even | Cloud Street| :w-north | | W1 | place | houses | even | Cloud Street| 1,2 |
When importing When importing
Then placex has no entry for W1 Then placex has no entry for W1
And W1 expands to interpolation And W1 expands to interpolation
| parent_place_id | start | end | | parent_place_id | start | end |
| W2 | 4 | 4 | | W2 | 4 | 4 |
When updating places When updating places
| osm | class | type | housenr | geometry | | osm | class | type | housenr | geometry |
| W1 | place | house | 3 | :w-building | | W1 | place | house | 3 | (1,2,3,4,1) |
Then placex contains Then placex contains
| object | parent_place_id | | object | parent_place_id |
| W1 | W2 | | W1 | W2 |
And W1 expands to no interpolation
Scenario: housenumbers added to interpolation Scenario: housenumbers added to interpolation
Given the scene building-with-parallel-streets Given the grid
| 10 | | | | 11 |
| | 1 | | 2 | |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | unclassified | Cloud Street | :w-south | | W2 | highway | unclassified | Cloud Street | 10,11 |
And the ways And the ways
| id | nodes | | id | nodes |
| 1 | 1,100,101,102,2 | | 1 | 1,2 |
And the places And the places
| osm | class | type | addr+interpolation | geometry | | osm | class | type | addr+interpolation | geometry |
| W1 | place | houses | even | :w-north | | W1 | place | houses | even | 1,2 |
When importing When importing
Then W1 expands to no interpolation Then W1 expands to no interpolation
When updating places When updating places
| osm | class | type | housenr | geometry | | osm | class | type | housenr |
| N1 | place | house | 2 | :n-north-w | | N1 | place | house | 2 |
| N2 | place | house | 6 | :n-north-e | | N2 | place | house | 6 |
And updating places
| osm | class | type | addr+interpolation | street | geometry |
| W1 | place | houses | even | Cloud Street| :w-north |
Then W1 expands to interpolation Then W1 expands to interpolation
| parent_place_id | start | end | | parent_place_id | start | end |
| W2 | 4 | 4 | | W2 | 4 | 4 |

View File

@@ -3,33 +3,44 @@ Feature: Updates of linked places
Tests that linked places are correctly added and deleted. Tests that linked places are correctly added and deleted.
Scenario: Linking is kept when boundary is updated Scenario: Linking is kept when boundary is updated
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing When importing
Then placex contains Then placex contains
| object | linked_place_id | | object | linked_place_id |
| N1 | R1 | | N1 | R1 |
When updating places When updating places
| osm | class | type | name | name+name:de | admin | geometry | | osm | class | type | name | name+name:de | admin | geometry |
| R1 | boundary | administrative | foo | Dingens | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | Dingens | 8 | (10,11,12,13,10) |
Then placex contains Then placex contains
| object | linked_place_id | | object | linked_place_id |
| N1 | R1 | | N1 | R1 |
Scenario: Add linked place when linking relation is renamed Scenario: Add linked place when linking relation is renamed
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing When importing
And sending search query "foo" Then placex contains
| object | linked_place_id |
| N1 | R1 |
When sending search query "foo"
| dups | | dups |
| 1 | | 1 |
Then results contain Then results contain
@@ -37,7 +48,7 @@ Feature: Updates of linked places
| R | | R |
When updating places When updating places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foobar | 8 | poly-area:0.1 | | R1 | boundary | administrative | foobar | 8 | (10,11,12,13,10) |
Then placex contains Then placex contains
| object | linked_place_id | | object | linked_place_id |
| N1 | - | | N1 | - |
@@ -49,12 +60,16 @@ Feature: Updates of linked places
| N | | N |
Scenario: Add linked place when linking relation is removed Scenario: Add linked place when linking relation is removed
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing When importing
And sending search query "foo" And sending search query "foo"
| dups | | dups |
@@ -74,9 +89,13 @@ Feature: Updates of linked places
| N | | N |
Scenario: Remove linked place when linking relation is added Scenario: Remove linked place when linking relation is added
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
When importing When importing
And sending search query "foo" And sending search query "foo"
| dups | | dups |
@@ -86,7 +105,7 @@ Feature: Updates of linked places
| N | | N |
When updating places When updating places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
Then placex contains Then placex contains
| object | linked_place_id | | object | linked_place_id |
| N1 | R1 | | N1 | R1 |
@@ -98,12 +117,16 @@ Feature: Updates of linked places
| R | | R |
Scenario: Remove linked place when linking relation is renamed Scenario: Remove linked place when linking relation is renamed
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foobar | 8 | poly-area:0.1 | | R1 | boundary | administrative | foobar | 8 | (10,11,12,13,10) |
When importing When importing
And sending search query "foo" And sending search query "foo"
| dups | | dups |
@@ -113,7 +136,7 @@ Feature: Updates of linked places
| N | | N |
When updating places When updating places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
Then placex contains Then placex contains
| object | linked_place_id | | object | linked_place_id |
| N1 | R1 | | N1 | R1 |
@@ -125,12 +148,16 @@ Feature: Updates of linked places
| R | | R |
Scenario: Update linking relation when linkee name is updated Scenario: Update linking relation when linkee name is updated
Given the 0.1 grid
| 10 | | 11 |
| | 3 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | rel | 8 | poly-area:0.1 | | R1 | boundary | administrative | rel | 8 | (10,11,12,13,10) |
And the places And the places
| osm | class | type | name+name:de | admin | geometry | | osm | class | type | name+name:de |
| N3 | place | city | pnt | 30 | 0.00001 0 | | N3 | place | city | pnt |
And the relations And the relations
| id | members | | id | members |
| 1 | N3:label | | 1 | N3:label |
@@ -142,8 +169,8 @@ Feature: Updates of linked places
| object | linked_place_id | name+name:de | | object | linked_place_id | name+name:de |
| N3 | R1 | pnt | | N3 | R1 | pnt |
When updating places When updating places
| osm | class | type | name+name:de | admin | geometry | | osm | class | type | name+name:de |
| N3 | place | city | newname | 30 | 0.00001 0 | | N3 | place | city | newname |
Then placex contains Then placex contains
| object | linked_place_id | name+name:de | | object | linked_place_id | name+name:de |
| N3 | R1 | newname | | N3 | R1 | newname |
@@ -152,12 +179,16 @@ Feature: Updates of linked places
| R1 | - | newname | | R1 | - | newname |
Scenario: Update linking relation when linkee name is deleted Scenario: Update linking relation when linkee name is deleted
Given the 0.1 grid
| 10 | | 11 |
| | 3 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | rel | 8 | poly-area:0.1 | | R1 | boundary | administrative | rel | 8 | (10,11,12,13,10) |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name |
| N3 | place | city | pnt | 30 | 0.00001 0 | | N3 | place | city | pnt |
And the relations And the relations
| id | members | | id | members |
| 1 | N3:label | | 1 | N3:label |
@@ -173,8 +204,8 @@ Feature: Updates of linked places
| osm | | osm |
| R1 | | R1 |
When updating places When updating places
| osm | class | type | name+name:de | admin | geometry | | osm | class | type | name+name:de |
| N3 | place | city | depnt | 30 | 0.00001 0 | | N3 | place | city | depnt |
Then placex contains Then placex contains
| object | linked_place_id | name+name:de | | object | linked_place_id | name+name:de |
| N3 | R1 | depnt | | N3 | R1 | depnt |
@@ -185,12 +216,16 @@ Feature: Updates of linked places
Then exactly 0 results are returned Then exactly 0 results are returned
Scenario: Updating linkee extratags keeps linker's extratags Scenario: Updating linkee extratags keeps linker's extratags
Given the 0.1 grid
| 10 | | 11 |
| | 3 | |
| 13 | | 12 |
Given the named places Given the named places
| osm | class | type | extra+wikidata | admin | geometry | | osm | class | type | extra+wikidata | admin | geometry |
| R1 | boundary | administrative | 34 | 8 | poly-area:0.1 | | R1 | boundary | administrative | 34 | 8 | (10,11,12,13,10) |
And the named places And the named places
| osm | class | type | geometry | | osm | class | type |
| N3 | place | city | 0.00001 0 | | N3 | place | city |
And the relations And the relations
| id | members | | id | members |
| 1 | N3:label | | 1 | N3:label |
@@ -199,19 +234,23 @@ Feature: Updates of linked places
| object | extratags | | object | extratags |
| R1 | 'wikidata' : '34', 'linked_place' : 'city' | | R1 | 'wikidata' : '34', 'linked_place' : 'city' |
When updating places When updating places
| osm | class | type | name | extra+oneway | admin | geometry | | osm | class | type | name | extra+oneway |
| N3 | place | city | newname | yes | 30 | 0.00001 0 | | N3 | place | city | newname | yes |
Then placex contains Then placex contains
| object | extratags | | object | extratags |
| R1 | 'wikidata' : '34', 'oneway' : 'yes', 'linked_place' : 'city' | | R1 | 'wikidata' : '34', 'oneway' : 'yes', 'linked_place' : 'city' |
Scenario: Remove linked_place info when linkee is removed Scenario: Remove linked_place info when linkee is removed
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing When importing
Then placex contains Then placex contains
| object | extratags | | object | extratags |
@@ -222,19 +261,23 @@ Feature: Updates of linked places
| R1 | | | R1 | |
Scenario: Update linked_place info when linkee type changes Scenario: Update linked_place info when linkee type changes
Given the 0.1 grid
| 10 | | 11 |
| | 1 | |
| 13 | | 12 |
Given the places Given the places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | city | foo | 0 0 | | N1 | place | city | foo |
And the places And the places
| osm | class | type | name | admin | geometry | | osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 | | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing When importing
Then placex contains Then placex contains
| object | extratags | | object | extratags |
| R1 | 'linked_place' : 'city' | | R1 | 'linked_place' : 'city' |
When updating places When updating places
| osm | class | type | name | geometry | | osm | class | type | name |
| N1 | place | town | foo | 0 0 | | N1 | place | town | foo |
Then placex contains Then placex contains
| object | extratags | | object | extratags |
| R1 | 'linked_place' : 'town' | | R1 | 'linked_place' : 'town' |

View File

@@ -3,9 +3,12 @@ Feature: Update of names in place objects
Test all naming related issues in updates Test all naming related issues in updates
Scenario: Delete postcode from postcode boundaries without ref Scenario: Delete postcode from postcode boundaries without ref
Given the grid with origin DE
| 1 | 2 |
| 4 | 3 |
Given the places Given the places
| osm | class | type | postcode | geometry | | osm | class | type | postcode | geometry |
| R1 | boundary | postal_code | 12345 | poly-area:0.5 | | R1 | boundary | postal_code | 12345 | (1,2,3,4,1) |
When importing When importing
And sending search query "12345" And sending search query "12345"
Then results contain Then results contain
@@ -13,6 +16,6 @@ Feature: Update of names in place objects
| 0 | R1 | | 0 | R1 |
When updating places When updating places
| osm | class | type | geometry | | osm | class | type | geometry |
| R1 | boundary | postal_code | poly-area:0.5 | | R1 | boundary | postal_code | (1,2,3,4,1) |
Then placex has no entry for R1 Then placex has no entry for R1

View File

@@ -2,38 +2,37 @@
Feature: Update parenting of objects Feature: Update parenting of objects
Scenario: POI inside building inherits addr:street change Scenario: POI inside building inherits addr:street change
Given the scene building-on-street-corner Given the grid
| 10 | | | | | | | 11 |
| | | 5 | | | 6 | | |
| | | | | | | | |
| | | | | 1 | | | |
| 12 | | 8 | | | 7 | | |
And the named places And the named places
| osm | class | type | geometry | | osm | class | type |
| N1 | amenity | bank | :n-inner | | N1 | amenity | bank |
| N2 | shop | bakery | :n-edge-NS |
| N3 | shop | supermarket| :n-edge-WE |
And the places And the places
| osm | class | type | street | housenr | geometry | | osm | class | type | street | housenr | geometry |
| W1 | building | yes | nowhere | 3 | :w-building | | W1 | building | yes | nowhere | 3 | (5,6,7,8,5) |
And the places And the places
| osm | class | type | name | geometry | | osm | class | type | name | geometry |
| W2 | highway | primary | bar | :w-WE | | W2 | highway | primary | bar | 10,11 |
| W3 | highway | residential | foo | :w-NS | | W3 | highway | residential | foo | 10,12 |
When importing When importing
Then placex contains Then placex contains
| object | parent_place_id | housenumber | | object | parent_place_id | housenumber |
| W1 | W2 | 3 | | W1 | W2 | 3 |
| N1 | W3 | 3 | | N1 | W2 | 3 |
| N2 | W3 | 3 |
| N3 | W2 | 3 |
When updating places When updating places
| osm | class | type | street | addr_place | housenr | geometry | | osm | class | type | street | addr_place | housenr | geometry |
| W1 | building | yes | foo | nowhere | 3 | :w-building | | W1 | building | yes | foo | nowhere | 3 | (5,6,7,8,5) |
And updating places And updating places
| osm | class | type | name | geometry | | osm | class | type | name |
| N3 | shop | supermarket| well | :n-edge-WE | | N1 | amenity | bank | well |
Then placex contains Then placex contains
| object | parent_place_id | housenumber | | object | parent_place_id | housenumber |
| W1 | W3 | 3 | | W1 | W3 | 3 |
| N1 | W3 | 3 | | N1 | W3 | 3 |
| N2 | W3 | 3 |
| N3 | W3 | 3 |
Scenario: Housenumber is reparented when street gets name matching addr:street Scenario: Housenumber is reparented when street gets name matching addr:street

View File

@@ -38,13 +38,13 @@ Feature: Update of postcode
Given the places Given the places
| osm | class | type | addr+postcode | addr+housenumber | geometry | | osm | class | type | addr+postcode | addr+housenumber | geometry |
| N34 | place | house | 01982 | 111 |country:de | | N34 | place | house | 01982 | 111 |country:de |
| N35 | place | house | 01982 | 5 |country:ch | | N35 | place | house | 01982 | 5 |country:fr |
When importing When importing
And marking for delete N34 And marking for delete N34
And updating postcodes And updating postcodes
Then location_postcode contains exactly Then location_postcode contains exactly
| country | postcode | geometry | | country | postcode | geometry |
| ch | 01982 | country:ch | | fr | 01982 | country:fr |
And there are word tokens for postcodes 01982 And there are word tokens for postcodes 01982
Scenario: Updating a postcode is reflected in postcode table Scenario: Updating a postcode is reflected in postcode table

View File

@@ -3,9 +3,12 @@ Feature: Update of simple objects
Testing simple updating functionality Testing simple updating functionality
Scenario: Do delete small boundary features Scenario: Do delete small boundary features
Given the 1.0 grid
| 1 | 2 |
| 4 | 3 |
Given the places Given the places
| osm | class | type | admin | geometry | | osm | class | type | admin | geometry |
| R1 | boundary | administrative | 3 | poly-area:1.0 | | R1 | boundary | administrative | 3 | (1,2,3,4,1) |
When importing When importing
Then placex contains Then placex contains
| object | rank_search | | object | rank_search |
@@ -14,24 +17,30 @@ Feature: Update of simple objects
Then placex has no entry for R1 Then placex has no entry for R1
Scenario: Do not delete large boundary features Scenario: Do not delete large boundary features
Given the 2.0 grid
| 1 | 2 |
| 4 | 3 |
Given the places Given the places
| osm | class | type | admin | geometry | | osm | class | type | admin | geometry |
| R1 | boundary | administrative | 3 | poly-area:5.0 | | R1 | boundary | administrative | 3 | (1,2,3,4,1) |
When importing When importing
Then placex contains Then placex contains
| object | rank_search | | object | rank_search |
| R1 | 6 | | R1 | 6 |
When marking for delete R1 When marking for delete R1
Then placex contains Then placex contains
| object | rank_search | | object | rank_search |
| R1 | 6 | | R1 | 6 |
Scenario: Do delete large features of low rank Scenario: Do delete large features of low rank
Given the 2.0 grid
| 1 | 2 |
| 4 | 3 |
Given the named places Given the named places
| osm | class | type | geometry | | osm | class | type | geometry |
| W1 | place | house | poly-area:5.0 | | W1 | place | house | (1,2,3,4,1) |
| R1 | natural | wood | poly-area:5.0 | | R1 | natural | wood | (1,2,3,4,1) |
| R2 | highway | residential | poly-area:5.0 | | R2 | highway | residential | (1,2,3,4,1) |
When importing When importing
Then placex contains Then placex contains
| object | rank_address | | object | rank_address |
@@ -61,12 +70,12 @@ Feature: Update of simple objects
Scenario: remove postcode place when house number is added Scenario: remove postcode place when house number is added
Given the places Given the places
| osm | class | type | postcode | geometry | | osm | class | type | postcode | geometry |
| N3 | place | postcode | 12345 | 1 -1 | | N3 | place | postcode | 12345 | country:de |
When importing When importing
Then placex has no entry for N3 Then placex has no entry for N3
When updating places When updating places
| osm | class | type | postcode | housenr | geometry | | osm | class | type | postcode | housenr | geometry |
| N3 | place | house | 12345 | 13 | 1 -1 | | N3 | place | house | 12345 | 13 | country:de |
Then placex contains Then placex contains
| object | class | type | | object | class | type |
| N3 | place | house | | N3 | place | house |

View File

@@ -142,6 +142,11 @@ def delete_places(context, oids):
context.nominatim.reindex_placex(context.db) context.nominatim.reindex_placex(context.db)
# Remove the output of the input, when all was right. Otherwise it will be
# output when there are errors that had nothing to do with the import
# itself.
context.log_capture.buffer.clear()
################################ THEN ################################## ################################ THEN ##################################
@then("(?P<table>placex|place) contains(?P<exact> exactly)?") @then("(?P<table>placex|place) contains(?P<exact> exactly)?")