]> git.openstreetmap.org Git - nominatim.git/commitdiff
add remaining db update tests
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 27 Nov 2016 13:44:21 +0000 (14:44 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 30 Dec 2016 21:58:58 +0000 (22:58 +0100)
test/bdd/db/query/search_simple.feature
test/bdd/db/update/naming.feature [new file with mode: 0644]
test/bdd/db/update/poi-inherited-postcode.feature [new file with mode: 0644]
test/bdd/db/update/search_terms.feature [new file with mode: 0644]

index f0c66f13bc6d59b35d3ebaf79ce3b876b5c88032..417df769857d9f947e8e713ecee1a2a363a93518 100644 (file)
@@ -11,3 +11,22 @@ Feature: Searching of simple objects
         Then results contain
          | ID | osm | class | type    | centroid |
          | 0  | N1  | place | village | 10 -10   |
+
+     Scenario: Updating postcode in postcode boundaries without ref
+        Given the places
+          | osm | class    | type        | postcode | geometry |
+          | R1  | boundary | postal_code | 12345    | poly-area:1.0 |
+        When importing
+        And searching for "12345"
+        Then results contain
+         | ID | osm_type | osm_id |
+         | 0  | R        | 1 |
+        When updating places
+          | osm | class    | type        | postcode | geometry |
+          | R1  | boundary | postal_code | 54321    | poly-area:1.0 |
+        And searching for "12345"
+        Then exactly 0 results are returned
+        When searching for "54321"
+        Then results contain
+         | ID | osm_type | osm_id |
+         | 0  | R        | 1 |
diff --git a/test/bdd/db/update/naming.feature b/test/bdd/db/update/naming.feature
new file mode 100644 (file)
index 0000000..4b5222f
--- /dev/null
@@ -0,0 +1,18 @@
+@DB
+Feature: Update of names in place objects
+    Test all naming related issues in updates
+
+    Scenario: Delete postcode from postcode boundaries without ref
+        Given the places
+          | osm | class    | type        | postcode | geometry |
+          | R1  | boundary | postal_code | 12345    | poly-area:0.5 |
+        When importing
+        And searching for "12345"
+        Then results contain
+         | ID | osm_type | osm_id |
+         | 0  | R        | 1 |
+        When updating places
+          | osm | class    | type        | geometry |
+          | R1  | boundary | postal_code | poly-area:0.5 |
+        Then placex has no entry for R1
+
diff --git a/test/bdd/db/update/poi-inherited-postcode.feature b/test/bdd/db/update/poi-inherited-postcode.feature
new file mode 100644 (file)
index 0000000..1b2065e
--- /dev/null
@@ -0,0 +1,57 @@
+@DB
+Feature: Update of POI-inherited poscode
+    Test updates of postcodes on street which was inherited from a related POI
+
+    Background: Street and house with postcode
+        Given the scene roads-with-pois
+        And the places
+         | osm | class | type  | housenr | postcode | street   | geometry |
+         | N1  | place | house | 1       | 12345    | North St |:p-S1 |
+        And the places
+         | osm | class   | type        | name     | geometry |
+         | W1  | highway | residential | North St | :w-north |
+        When importing
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+
+    Scenario: POI-inherited postcode remains when way type is changed
+        When updating places
+         | osm | class   | type         | name     | geometry |
+         | W1  | highway | unclassified | North St | :w-north |
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+
+    Scenario: POI-inherited postcode remains when way name is changed
+        When updating places
+         | osm | class   | type         | name     | geometry |
+         | W1  | highway | unclassified | South St | :w-north |
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+
+    Scenario: POI-inherited postcode remains when way geometry is changed
+        When updating places
+         | osm | class   | type         | name     | geometry |
+         | W1  | highway | unclassified | South St | :w-south |
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+
+    Scenario: POI-inherited postcode is added when POI postcode changes
+        When updating places
+         | osm | class | type  | housenr | postcode | street   | geometry |
+         | N1  | place | house | 1       | 54321    | North St |:p-S1 |
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 54321 |
+
+    Scenario: POI-inherited postcode remains when POI geometry changes
+        When updating places
+         | osm | class | type  | housenr | postcode | street   | geometry |
+         | N1  | place | house | 1       | 12345    | North St |:p-S2 |
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+
diff --git a/test/bdd/db/update/search_terms.feature b/test/bdd/db/update/search_terms.feature
new file mode 100644 (file)
index 0000000..07dbd45
--- /dev/null
@@ -0,0 +1,21 @@
+@DB
+Feature: Update of search terms
+    Tests that search_name table is updated correctly
+
+    Scenario: POI-inherited postcode remains when another POI is deleted
+        Given the scene roads-with-pois
+        And the places
+         | osm | class | type  | housenr | postcode | street   | geometry |
+         | N1  | place | house | 1       | 12345    | North St |:p-S1 |
+         | N2  | place | house | 2       |          | North St |:p-S2 |
+        And the places
+         | osm | class   | type        | name     | geometry |
+         | W1  | highway | residential | North St | :w-north |
+        When importing
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |
+        When marking for delete N2
+        Then search_name contains
+         | object | nameaddress_vector |
+         | W1     | 12345 |