]> git.openstreetmap.org Git - nominatim.git/commitdiff
bdd: remove special case for osm_type field
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 9 Mar 2023 16:44:34 +0000 (17:44 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 9 Mar 2023 16:44:34 +0000 (17:44 +0100)
The fuzzy field check hide cover formatting errors. Use 'osm' when
only caring about the conent.

test/bdd/db/import/interpolation.feature
test/bdd/db/import/linking.feature
test/bdd/db/import/parenting.feature
test/bdd/db/query/interpolation.feature
test/bdd/db/update/linked_places.feature
test/bdd/steps/http_responses.py

index 56ca4cc16f9961266c47397c6e50639f23294c46..ddaae631d18f43796b6e6fae38d0196afad095c8 100644 (file)
@@ -273,12 +273,12 @@ Feature: Import of address interpolations
           | W3              | 14    | 14 |
         When sending search query "16 Cloud Street"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 4 |
+         | ID | osm |
+         | 0  | N |
         When sending search query "14 Cloud Street"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | W        | 11 |
+         | ID | osm |
+         | 0  | W11 |
 
     Scenario: addr:street on housenumber way
         Given the grid
@@ -318,12 +318,12 @@ Feature: Import of address interpolations
           | W3              | 14    | 14 |
         When sending search query "16 Cloud Street"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 4 |
+         | ID | osm |
+         | 0  | N |
         When sending search query "14 Cloud Street"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | W        | 11 |
+         | ID | osm |
+         | 0  | W11 |
 
     Scenario: Geometry of points and way don't match (github #253)
         Given the places
@@ -401,8 +401,8 @@ Feature: Import of address interpolations
           | 2     | 8   | 10,11 |
         When sending jsonv2 reverse coordinates 1,1
         Then results contain
-          | ID | osm_type | osm_id | type  | display_name |
-          | 0  | node     | 1      | house | 0 |
+          | ID | osm | type  | display_name |
+          | 0  | N1  | house | 0 |
 
     Scenario: Parenting of interpolation with additional tags
         Given the grid
index 0fb3f76dbb2365d429c2a6ab275d6b22386925b0..dfa4b77c1a6019475004182683065baedfd0e8ac 100644 (file)
@@ -55,8 +55,8 @@ Feature: Linking of places
          | R23    | -   |
         When sending search query "rhein"
         Then results contain
-         | osm_type |
-         | R |
+         | osm |
+         | R13 |
 
     Scenario: Relations are not linked when in waterway relations
         Given the grid
@@ -81,9 +81,9 @@ Feature: Linking of places
          | R2     | - |
         When sending search query "rhein"
         Then results contain
-          | ID | osm_type |
-          |  0 | R |
-          |  1 | W |
+          | ID | osm |
+          |  0 | R |
+          |  1 | W |
 
 
     Scenario: Empty waterway relations are handled correctly
@@ -138,8 +138,8 @@ Feature: Linking of places
          | W2     | R1 |
         When sending search query "rhein2"
         Then results contain
-         | osm_type |
-         | W |
+         | osm |
+         | W |
 
     # github #573
     Scenario: Boundaries should only be linked to places
@@ -205,14 +205,14 @@ Feature: Linking of places
          | city |
          | Berlin |
         Then results contain
-          | ID | osm_type | osm_id |
-          |  0 | R | 13 |
+          | ID | osm |
+          |  0 | R13 |
         When sending search query ""
          | state |
          | Berlin |
         Then results contain
-          | ID | osm_type | osm_id |
-          |  0 | R | 13 |
+          | ID | osm |
+          |  0 | R13 |
 
 
     Scenario: Boundaries without place tags only link against same admin level
@@ -237,14 +237,14 @@ Feature: Linking of places
          | state |
          | Berlin |
         Then results contain
-          | ID | osm_type | osm_id |
-          |  0 | R | 13 |
+          | ID | osm |
+          |  0 | R13 |
         When sending search query ""
          | city |
          | Berlin |
         Then results contain
-          | ID | osm_type | osm_id |
-          |  0 | N | 2 |
+          | ID | osm |
+          |  0 | N |
 
     # github #1352
     Scenario: Do not use linked centroid when it is outside the area
index 5de3fde6bc8c90a0ced565fc6b8924ac08e4a6a5..c349b69f63ee1b1b03053189cf078e02e584148f 100644 (file)
@@ -23,12 +23,12 @@ Feature: Parenting of objects
          | N2     | W1 |
         When sending search query "4 galoo"
         Then results contain
-         | ID | osm_type | osm_id | display_name |
-         | 0  | N        | 1      | 4, galoo, 12345, Deutschland |
+         | ID | osm | display_name |
+         | 0  | N1  | 4, galoo, 12345, Deutschland |
         When sending search query "5 galoo"
         Then results contain
-         | ID | osm_type | osm_id | display_name |
-         | 0  | N        | 2      | 5, galoo, 99999, Deutschland |
+         | ID | osm | display_name |
+         | 0  | N2  | 5, galoo, 99999, Deutschland |
 
     Scenario: Address without tags, closest street
         Given the grid
index 602ac434a2dd6741171d600f3525f8fc3751d4da..e709787d28e1540eea6e44414a02ffb911a82dcf 100644 (file)
@@ -43,7 +43,7 @@ Feature: Query of address interpolations
         And the places
           | osm | class | type  | housenr | geometry |
           | N1  | place | house | 2       | 1        |
-          | N3  | place | house | 16      | 3        |
+          | N3  | place | house | 18      | 3        |
         And the ways
           | id | nodes |
           | 1  | 1,3   |
index c277e8bd1e69c47f0f256dcecadcdff8030c4996..539d928543e5942f3d3647ded9a3be010b3df24d 100644 (file)
@@ -44,8 +44,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | R |
+         | osm |
+         | R1 |
         When updating places
          | osm | class    | type           | name   | admin | geometry |
          | R1  | boundary | administrative | foobar | 8     | (10,11,12,13,10) |
@@ -56,8 +56,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | N |
+         | osm |
+         | N1 |
 
     Scenario: Add linked place when linking relation is removed
         Given the 0.1 grid
@@ -75,8 +75,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | R |
+         | osm |
+         | R1 |
         When marking for delete R1
         Then placex contains
          | object | linked_place_id |
@@ -85,8 +85,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | N |
+         | osm |
+         | N1 |
 
     Scenario: Remove linked place when linking relation is added
         Given the 0.1 grid
@@ -101,8 +101,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | N |
+         | osm |
+         | N1 |
         When updating places
          | osm | class    | type           | name   | admin | geometry |
          | R1  | boundary | administrative | foo    | 8     | (10,11,12,13,10) |
@@ -113,8 +113,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | R |
+         | osm |
+         | R1 |
 
     Scenario: Remove linked place when linking relation is renamed
         Given the 0.1 grid
@@ -132,8 +132,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | N |
+         | osm |
+         | N1 |
         When updating places
          | osm | class    | type           | name   | admin | geometry |
          | R1  | boundary | administrative | foo    | 8     | (10,11,12,13,10) |
@@ -144,8 +144,8 @@ Feature: Updates of linked places
          | dups |
          | 1    |
         Then results contain
-         | osm_type |
-         | R |
+         | osm |
+         | R1 |
 
     Scenario: Update linking relation when linkee name is updated
         Given the 0.1 grid
index 266a3663fab137292e505e58f32cf4df3ba602d4..a3493b975790441881f8b76115d7567edd9535dd 100644 (file)
@@ -137,8 +137,6 @@ class GenericResponse:
                 elif name == 'osm':
                     self.check_row_field(i, 'osm_type', OsmType(value[0]))
                     self.check_row_field(i, 'osm_id', Field(value[1:]))
-                elif name == 'osm_type':
-                    self.check_row_field(i, 'osm_type', OsmType(value[0]))
                 elif name == 'centroid':
                     if ' ' in value:
                         lon, lat = value.split(' ')
@@ -146,8 +144,8 @@ class GenericResponse:
                         lon, lat = context.osm.grid_node(int(value))
                     else:
                         raise RuntimeError("Context needed when using grid coordinates")
-                    self.check_row_field(i, 'lat', Field(float(lat)), base=subdict)
-                    self.check_row_field(i, 'lon', Field(float(lon)), base=subdict)
+                    self.check_row_field(i, 'lat', Field(float(lat)))
+                    self.check_row_field(i, 'lon', Field(float(lon)))
                 elif '+' in name:
                     self.assert_subfield(i, name.split('+'), value)
                 else: