]> git.openstreetmap.org Git - nominatim.git/commitdiff
switch BDD tests to always use search API
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 6 Jun 2021 13:27:52 +0000 (15:27 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 6 Jun 2021 13:27:52 +0000 (15:27 +0200)
13 files changed:
test/bdd/db/import/addressing.feature
test/bdd/db/import/country.feature
test/bdd/db/import/interpolation.feature
test/bdd/db/import/linking.feature
test/bdd/db/import/parenting.feature
test/bdd/db/import/postcodes.feature
test/bdd/db/import/search_name.feature
test/bdd/db/query/normalization.feature
test/bdd/db/query/search_simple.feature
test/bdd/db/update/linked_places.feature
test/bdd/db/update/naming.feature
test/bdd/steps/http_responses.py
test/bdd/steps/steps_api_queries.py

index 479ddd31d39f9011412d78ebeeb7591424628e14..b6345baff2df1ed051b3777229185cf4467797de 100644 (file)
@@ -17,10 +17,10 @@ Feature: Address computation
         Then place_addressline doesn't contain
             | object | address |
             | N1     | N2      |
-        When searching for "Square"
+        When sending search query "Square"
         Then results contain
-           | osm_type | osm_id | name              |
-           | N        | 1      | Square, East Farm |
+           | osm | display_name      |
+           | N1  | Square, East Farm |
 
     Scenario: given two place nodes, the closer one wins for the address
         Given the grid
@@ -347,10 +347,10 @@ Feature: Address computation
         And place_addressline doesn't contain
            | object | address |
            | W1     | R1      |
-        When searching for "Bolder"
+        When sending search query "Bolder"
         Then results contain
-           | osm_type | osm_id | name                    |
-           | N        | 1      | Bolder, Wonderway, Left |
+           | osm | display_name            |
+           | N1  | Bolder, Wonderway, Left |
 
     Scenario: addr:* tags do not produce addresslines when the parent has the address part
         Given the grid
@@ -371,10 +371,10 @@ Feature: Address computation
         And place_addressline doesn't contain
            | object | address |
            | N1     | R1      |
-        When searching for "Bolder"
+        When sending search query "Bolder"
         Then results contain
-           | osm_type | osm_id | name                     |
-           | N        | 1      | Bolder, Wonderway, Outer |
+           | osm | display_name             |
+           | N1  | Bolder, Wonderway, Outer |
 
     Scenario: addr:* tags on outside do not produce addresslines when the parent has the address part
         Given the grid
@@ -397,10 +397,10 @@ Feature: Address computation
         And place_addressline doesn't contain
            | object | address |
            | N1     | R1      |
-        When searching for "Bolder"
+        When sending search query "Bolder"
         Then results contain
-           | osm_type | osm_id | name                    |
-           | N        | 1      | Bolder, Wonderway, Left |
+           | osm | display_name            |
+           | N1  | Bolder, Wonderway, Left |
 
     Scenario: POIs can correct address parts on the fly
         Given the grid
@@ -425,11 +425,11 @@ Feature: Address computation
            | object | address |
            | N1     | R1      |
            | N2     | R2      |
-        When searching for "Bolder"
+        When sending search query "Bolder"
         Then results contain
-           | osm_type | osm_id | name                    |
-           | N        | 1      | Bolder, Wonderway, Left |
-        When searching for "Leftside"
+           | osm | display_name            |
+           | N1  | Bolder, Wonderway, Left |
+        When sending search query "Leftside"
         Then results contain
-           | osm_type | osm_id | name                       |
-           | N        | 2      | Leftside, Wonderway, Right |
+           | osm | display_name               |
+           | N2  | Leftside, Wonderway, Right |
index 21f95e1f38c6de3a16892a407e3780a59018dc02..354d5c2f7262224aad612346805fb582f612b475 100644 (file)
@@ -10,16 +10,16 @@ Feature: Country handling
             | osm  | class    | type          | name  | geometry   |
             | N1   | place    | town          | Wenig | country:de |
         When importing
-        When searching for "Wenig, Loudou"
+        When sending search query "Wenig, Loudou"
         Then results contain
-            | osm_type | osm_id | name |
-            | N        | 1      | Wenig, Deutschland |
-        When searching for "Wenig"
+            | osm | display_name |
+            | N1  | Wenig, Deutschland |
+        When sending search query "Wenig"
             | accept-language |
             | xy,en |
         Then results contain
-            | osm_type | osm_id | name |
-            | N        | 1      | Wenig, Loudou |
+            | osm | display_name |
+            | N1  | Wenig, Loudou |
     Scenario: OSM country relations outside expected boundaries are ignored
         Given the places
             | osm  | class    | type           | admin | name+name:xy | country | geometry |
@@ -28,20 +28,20 @@ Feature: Country handling
             | osm  | class    | type          | name  | geometry   |
             | N1   | place    | town          | Wenig | country:de |
         When importing
-        When searching for "Wenig"
+        When sending search query "Wenig"
             | accept-language |
             | xy,en |
         Then results contain
-            | osm_type | osm_id | name |
-            | N        | 1      | Wenig, Germany |
+            | osm | display_name |
+            | N1  | Wenig, Germany |
     Scenario: Pre-defined country names are used
         Given the places
             | osm  | class    | type          | name  | geometry   |
             | N1   | place    | town          | Ingb  | country:ch |
         When importing
-        And searching for "Ingb"
+        And sending search query "Ingb"
             | accept-language |
             | en,de |
         Then results contain
-            | osm_type | osm_id | name |
-            | N        | 1      | Ingb, Switzerland |
+            | osm | display_name |
+            | N1  | Ingb, Switzerland |
index 52971295c5ced00253e7f39b6151f3640fe51fb2..181e87eec56f3b471616cf883964f4e84eb4bd2b 100644 (file)
@@ -240,11 +240,11 @@ Feature: Import of address interpolations
         Then W11 expands to interpolation
           | parent_place_id | start | end |
           | W3              | 12    | 16 |
-        When searching for "16 Cloud Street"
+        When sending search query "16 Cloud Street"
         Then results contain
          | ID | osm_type | osm_id |
          | 0  | N        | 4 |
-        When searching for "14 Cloud Street"
+        When sending search query "14 Cloud Street"
         Then results contain
          | ID | osm_type | osm_id |
          | 0  | W        | 11 |
@@ -282,11 +282,11 @@ Feature: Import of address interpolations
         Then W11 expands to interpolation
           | parent_place_id | start | end |
           | W3              | 12    | 16 |
-        When searching for "16 Cloud Street"
+        When sending search query "16 Cloud Street"
         Then results contain
          | ID | osm_type | osm_id |
          | 0  | N        | 4 |
-        When searching for "14 Cloud Street"
+        When sending search query "14 Cloud Street"
         Then results contain
          | ID | osm_type | osm_id |
          | 0  | W        | 11 |
index e2696e637098dab0d316c487d0764e348e93ca9c..915c13b3a9e184376a12792ba3d49e38338af9e5 100644 (file)
@@ -47,7 +47,7 @@ Feature: Linking of places
          | W2     | R13 |
          | R13    | -   |
          | R23    | -   |
-        When searching for "rhein"
+        When sending search query "rhein"
         Then results contain
          | osm_type |
          | R |
@@ -98,7 +98,7 @@ Feature: Linking of places
          | object | linked_place_id |
          | W1     | - |
          | R1     | - |
-        When searching for "rhein"
+        When sending search query "rhein"
         Then results contain
           | ID | osm_type |
           |  0 | R |
@@ -119,7 +119,7 @@ Feature: Linking of places
          | object | linked_place_id |
          | W1     | -  |
          | W2     | R1 |
-        When searching for "rhein2"
+        When sending search query "rhein2"
         Then results contain
          | osm_type |
          | W |
@@ -172,13 +172,13 @@ Feature: Linking of places
         And placex contains
          | object | rank_address |
          | R13    | 16 |
-        When searching for ""
+        When sending search query ""
          | city |
          | Berlin |
         Then results contain
           | ID | osm_type | osm_id |
           |  0 | R | 13 |
-        When searching for ""
+        When sending search query ""
          | state |
          | Berlin |
         Then results contain
@@ -200,13 +200,13 @@ Feature: Linking of places
         And placex contains
          | object | rank_address |
          | R13    | 8 |
-        When searching for ""
+        When sending search query ""
          | state |
          | Berlin |
         Then results contain
           | ID | osm_type | osm_id |
           |  0 | R | 13 |
-        When searching for ""
+        When sending search query ""
          | city |
          | Berlin |
         Then results contain
index 62d65cef571d9bb0eafad56ae8ab70225401605a..b5210f9439b55a5f328d28f0141ac695629a6334 100644 (file)
@@ -18,13 +18,13 @@ Feature: Parenting of objects
          | object | parent_place_id |
          | N1     | W1 |
          | N2     | W1 |
-        When searching for "4 galoo"
+        When sending search query "4 galoo"
         Then results contain
-         | ID | osm_type | osm_id | langaddress |
+         | ID | osm_type | osm_id | display_name |
          | 0  | N        | 1      | 4, galoo, 12345 |
-        When searching for "5 galoo"
+        When sending search query "5 galoo"
         Then results contain
-         | ID | osm_type | osm_id | langaddress |
+         | ID | osm_type | osm_id | display_name |
          | 0  | N        | 2      | 5, galoo, 99999 |
 
     Scenario: Address without tags, closest street
index 3d1dc489482fb90cc65b730175398804473aff05..6102e99ba1b00925bbd754b700c9e80344736d9f 100644 (file)
@@ -148,11 +148,11 @@ Feature: Import of postcodes
            | country | postcode | geometry |
            | gb      | EH4 7EA  | country:gb |
            | gb      | E4 7EA   | country:gb |
-        When searching for "EH4 7EA"
+        When sending search query "EH4 7EA"
         Then results contain
-           | type     | placename |
+           | type     | display_name |
            | postcode | EH4 7EA      |
-        When searching for "E4 7EA"
+        When sending search query "E4 7EA"
         Then results contain
-           | type     | placename |
+           | type     | display_name |
            | postcode | E4 7EA      |
index 9e899053180b6cf025bd33940a493d846ffbbfa5..d393b8f3381a7a493d4597cd113b77d4a331287f 100644 (file)
@@ -48,18 +48,18 @@ Feature: Creation of search terms
         Then search_name contains
          | object | nameaddress_vector |
          | N1     | #Rose Street, Walltown |
-        When searching for "23 Rose Street, Walltown"
+        When sending search query "23 Rose Street, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "Walltown, Rose Street 23"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "Walltown, Rose Street 23"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "Rose Street 23, Walltown"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "Rose Street 23, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
+         | osm | display_name |
+         | N1  | 23, Rose Street |
 
     Scenario: Searching for unknown addr: tags also works for multiple words
         Given the scene roads-with-pois
@@ -73,18 +73,18 @@ Feature: Creation of search terms
         Then search_name contains
          | object | nameaddress_vector |
          | N1     | #Rose Street, rose, Little, Big, Town |
-        When searching for "23 Rose Street, Little Big Town"
+        When sending search query "23 Rose Street, Little Big Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "Rose Street 23, Little Big Town"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "Rose Street 23, Little Big Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "Little big Town, Rose Street 23"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "Little big Town, Rose Street 23"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
+         | osm | display_name |
+         | N1  | 23, Rose Street |
 
      Scenario: Unnamed POI has no search entry when it has known addr: tags
         Given the scene roads-with-pois
@@ -96,10 +96,10 @@ Feature: Creation of search terms
          | W1  | highway | residential | Rose Street | Walltown | :w-north |
         When importing
         Then search_name has no entry for N1
-        When searching for "23 Rose Street, Walltown"
+        When sending search query "23 Rose Street, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
+         | osm | display_name |
+         | N1  | 23, Rose Street |
 
     Scenario: Unnamed POI must have a house number to get a search entry
         Given the scene roads-with-pois
@@ -128,23 +128,23 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector | nameaddress_vector |
          | N1     | #Walltown   | Strange, Town |
-        When searching for "23 Rose Street"
+        When sending search query "23 Rose Street"
         Then exactly 1 results are returned
         And results contain
-         | osm_type | osm_id | name |
-         | W        | 1      | Rose Street, Strange Town |
-        When searching for "23 Walltown, Strange Town"
+         | osm | display_name |
+         | W1  | Rose Street, Strange Town |
+        When sending search query "23 Walltown, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Walltown, Strange Town |
-        When searching for "Walltown 23, Strange Town"
+         | osm | display_name |
+         | N1  | 23, Walltown, Strange Town |
+        When sending search query "Walltown 23, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Walltown, Strange Town |
-        When searching for "Strange Town, Walltown 23"
+         | osm | display_name |
+         | N1  | 23, Walltown, Strange Town |
+        When sending search query "Strange Town, Walltown 23"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Walltown, Strange Town |
+         | osm | display_name |
+         | N1  | 23, Walltown, Strange Town |
 
     Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
         Given the scene roads-with-pois
@@ -159,26 +159,26 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector      | nameaddress_vector      |
          | N1     | #Walltown, #Blue house | Walltown, Strange, Town |
-        When searching for "23 Walltown, Strange Town"
+        When sending search query "23 Walltown, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Walltown, Strange Town |
-        When searching for "Walltown 23, Strange Town"
+         | osm | display_name |
+         | N1  | Blue house, 23, Walltown, Strange Town |
+        When sending search query "Walltown 23, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Walltown, Strange Town |
-        When searching for "Strange Town, Walltown 23"
+         | osm | display_name |
+         | N1  | Blue house, 23, Walltown, Strange Town |
+        When sending search query "Strange Town, Walltown 23"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Walltown, Strange Town |
-        When searching for "Strange Town, Walltown 23, Blue house"
+         | osm | display_name |
+         | N1  | Blue house, 23, Walltown, Strange Town |
+        When sending search query "Strange Town, Walltown 23, Blue house"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Walltown, Strange Town |
-        When searching for "Strange Town, Walltown, Blue house"
+         | osm | display_name |
+         | N1  | Blue house, 23, Walltown, Strange Town |
+        When sending search query "Strange Town, Walltown, Blue house"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Walltown, Strange Town |
+         | osm | display_name |
+         | N1  | Blue house, 23, Walltown, Strange Town |
 
     Scenario: Named POIs can be found when unknown multi-word addr:place is present
         Given the scene roads-with-pois
@@ -193,14 +193,14 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector      | nameaddress_vector      |
          | N1     | #Moon sun, #Blue house | Moon, Sun, Strange, Town |
-        When searching for "23 Moon Sun, Strange Town"
+        When sending search query "23 Moon Sun, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Moon sun, Strange Town |
-        When searching for "Blue house, Moon Sun, Strange Town"
+         | osm | display_name |
+         | N1  | Blue house, 23, Moon sun, Strange Town |
+        When sending search query "Blue house, Moon Sun, Strange Town"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Blue house, 23, Moon sun, Strange Town |
+         | osm | display_name |
+         | N1  | Blue house, 23, Moon sun, Strange Town |
 
     Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
         Given the scene roads-with-pois
@@ -215,16 +215,16 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector | nameaddress_vector |
          | N1     | #Walltown   | Strange, Town      |
-        When searching for "23 Rose Street, Walltown"
+        When sending search query "23 Rose Street, Walltown"
         Then exactly 1 result is returned
         And results contain
-         | osm_type | osm_id | name |
-         | W        | 1      | Rose Street, Strange Town |
-        When searching for "23  Walltown"
+         | osm | display_name |
+         | W1  | Rose Street, Strange Town |
+        When sending search query "23  Walltown"
         Then exactly 1 result is returned
         And results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Walltown, Strange Town |
+         | osm | display_name |
+         | N1  | 23, Walltown, Strange Town |
 
     Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
         Given the scene roads-with-pois
@@ -236,11 +236,11 @@ Feature: Creation of search terms
          | W1  | highway | residential | Rose Street | :w-north |
         When importing
         Then search_name has no entry for N1
-        When searching for "23 Rose Street"
+        When sending search query "23 Rose Street"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "23 Lily Street"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "23 Lily Street"
         Then exactly 0 results are returned
 
     Scenario: An unknown addr:street is ignored
@@ -253,11 +253,11 @@ Feature: Creation of search terms
          | W1  | highway | residential | Rose Street | :w-north |
         When importing
         Then search_name has no entry for N1
-        When searching for "23 Rose Street"
+        When sending search query "23 Rose Street"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | 23, Rose Street |
-        When searching for "23 Lily Street"
+         | osm | display_name |
+         | N1  | 23, Rose Street |
+        When sending search query "23 Lily Street"
         Then exactly 0 results are returned
 
     Scenario: Named POIs get unknown address tags added in the search_name table
@@ -272,26 +272,26 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector | nameaddress_vector |
          | N1     | #Green Moss | #Rose Street, Walltown |
-        When searching for "Green Moss, Rose Street, Walltown"
+        When sending search query "Green Moss, Rose Street, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, 26, Rose Street |
-        When searching for "Green Moss, 26, Rose Street, Walltown"
+         | osm | display_name |
+         | N1  | Green Moss, 26, Rose Street |
+        When sending search query "Green Moss, 26, Rose Street, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, 26, Rose Street |
-        When searching for "26, Rose Street, Walltown"
+         | osm | display_name |
+         | N1  | Green Moss, 26, Rose Street |
+        When sending search query "26, Rose Street, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, 26, Rose Street |
-        When searching for "Rose Street 26, Walltown"
+         | osm | display_name |
+         | N1  | Green Moss, 26, Rose Street |
+        When sending search query "Rose Street 26, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, 26, Rose Street |
-        When searching for "Walltown, Rose Street 26"
+         | osm | display_name |
+         | N1  | Green Moss, 26, Rose Street |
+        When sending search query "Walltown, Rose Street 26"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, 26, Rose Street |
+         | osm | display_name |
+         | N1  | Green Moss, 26, Rose Street |
 
     Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
         Given the scene roads-with-pois
@@ -306,12 +306,12 @@ Feature: Creation of search terms
         Then search_name contains
          | object | name_vector | nameaddress_vector |
          | N1     | #Green Moss | Walltown |
-        When searching for "Green Moss, Rose Street, Walltown"
+        When sending search query "Green Moss, Rose Street, Walltown"
         Then exactly 0 result is returned
-        When searching for "Green Moss, Walltown"
+        When sending search query "Green Moss, Walltown"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | Green Moss, Walltown, Strange Town |
+         | osm | display_name |
+         | N1  | Green Moss, Walltown, Strange Town |
 
     Scenario: Named POIs inherit address from parent
         Given the scene roads-with-pois
index 8a324a229b86bfaa450a35d5d095bed647d483d3..350455891495f470a92954b0545a260c8c7531dd 100644 (file)
@@ -11,44 +11,44 @@ Feature: Import and search of names
         Then placex contains
           | object | class  | type     | name+name |
           | N1     | place  | locality | FooBar |
-        When searching for "FooBar"
+        When sending search query "FooBar"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "foobar"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "foobar"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "fOObar"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "fOObar"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "FOOBAR"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "FOOBAR"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
+         | ID | osm |
+         | 0  | N1 |
 
     Scenario: Multiple spaces in name
         Given the places
           | osm | class | type      | name |
           | N1  | place | locality  | one two  three |
         When importing
-        When searching for "one two three"
+        When sending search query "one two three"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "one   two three"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "one   two three"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "one two  three"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "one two  three"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "    one two three"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "    one two three"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
+         | ID | osm |
+         | 0  | N1 |
 
     Scenario: Special characters in name
         Given the places
@@ -59,58 +59,58 @@ Feature: Import and search of names
           | N4  | place | locality  | space |
           | N5  | place | locality  | mountain |
         When importing
-        When searching for "Jim-Knopf-Str"
+        When sending search query "Jim-Knopf-Str"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "Jim Knopf-Str"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "Jim Knopf-Str"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "Jim Knopf Str"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "Jim Knopf Str"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "Jim/Knopf-Str"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "Jim/Knopf-Str"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "Jim-Knopfstr"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "Jim-Knopfstr"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 1 |
-        When searching for "Smith/Weston"
+         | ID | osm |
+         | 0  | N1 |
+        When sending search query "Smith/Weston"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 2 |
-        When searching for "Smith Weston"
+         | ID | osm |
+         | 0  | N2 |
+        When sending search query "Smith Weston"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 2 |
-        When searching for "Smith-Weston"
+         | ID | osm |
+         | 0  | N2 |
+        When sending search query "Smith-Weston"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 2 |
-        When searching for "space mountain"
+         | ID | osm |
+         | 0  | N2 |
+        When sending search query "space mountain"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 3 |
-        When searching for "space-mountain"
+         | ID | osm |
+         | 0  | N3 |
+        When sending search query "space-mountain"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 3 |
-        When searching for "space/mountain"
+         | ID | osm |
+         | 0  | N3 |
+        When sending search query "space/mountain"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 3 |
-        When searching for "space\mountain"
+         | ID | osm |
+         | 0  | N3 |
+        When sending search query "space\mountain"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 3 |
-        When searching for "space(mountain)"
+         | ID | osm |
+         | 0  | N3 |
+        When sending search query "space(mountain)"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | N        | 3 |
+         | ID | osm |
+         | 0  | N3 |
 
     Scenario: Landuse with name are found
         Given the places
@@ -118,34 +118,32 @@ Feature: Import and search of names
           | R1  | natural  | meadow      | landuse1 | (0 0, 1 0, 1 1, 0 1, 0 0) |
           | R2  | landuse  | industrial  | landuse2 | (0 0, -1 0, -1 -1, 0 -1, 0 0) |
         When importing
-        When searching for "landuse1"
+        When sending search query "landuse1"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 1 |
-        When searching for "landuse2"
+         | ID | osm |
+         | 0  | R1 |
+        When sending search query "landuse2"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 2 |
+         | ID | osm |
+         | 0  | R2 |
 
     Scenario: Postcode boundaries without ref
         Given the places
           | osm | class    | type        | postcode | geometry |
           | R1  | boundary | postal_code | 12345    | (0 0, 1 0, 1 1, 0 1, 0 0) |
         When importing
-        When searching for "12345"
+        When sending search query "12345"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 1 |
+         | ID | osm |
+         | 0  | R1 |
 
     Scenario: Unprintable characters in postcodes are ignored
         Given the named places
             | osm  | class   | type   | address |
             | N234 | amenity | prison | 'postcode' : u'1234\u200e' |
         When importing
-        And searching for "1234"
-        Then results contain
-         | ID | osm_type |
-         | 0  | P        |
+        And sending search query "1234"
+        Then result 0 has not attributes osm_type
 
     Scenario Outline: Housenumbers with special characters are found
         Given the grid
@@ -158,10 +156,10 @@ Feature: Import and search of names
             | osm | class    | type | housenr | geometry |
             | N1  | building | yes  | <nr>    | 9        |
         When importing
-        And searching for "Main St <nr>"
+        And sending search query "Main St <nr>"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | <nr>, Main St |
+         | osm | display_name |
+         | N1  | <nr>, Main St |
 
     Examples:
         | nr |
@@ -186,10 +184,10 @@ Feature: Import and search of names
             | osm | class    | type | housenr   | geometry |
             | N1  | building | yes  | <nr-list> | 9        |
         When importing
-        And searching for "Main St <nr>"
+        And sending search query "Main St <nr>"
         Then results contain
-         | osm_type | osm_id | name |
-         | N        | 1      | <nr-list>, Main St |
+         | osm | display_name |
+         | N1  | <nr-list>, Main St |
 
     Examples:
         | nr-list    | nr |
index daf83cea04d7e25c606b4098db124c6aaba4e087..7f141c4c0d56f275ac71ec27cabf707e7dbe957f 100644 (file)
@@ -7,31 +7,29 @@ Feature: Searching of simple objects
           | osm | class | type    | name+name | geometry   |
           | N1  | place | village | Foo       | 10.0 -10.0 |
         When importing
-        And searching for "Foo"
+        And sending search query "Foo"
         Then results contain
-         | ID | osm | class | type    | centroid |
-         | 0  | N1  | place | village | 10 -10   |
+         | ID | osm | category | 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"
+        And sending search query "12345"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 1 |
+         | ID | osm |
+         | 0  | R1 |
         When updating places
           | osm | class    | type        | postcode | geometry |
           | R1  | boundary | postal_code | 54321    | poly-area:1.0 |
-        And searching for "12345"
+        And sending search query "12345"
+        Then result 0 has not attributes osm_type
+        When sending search query "54321"
         Then results contain
-         | osm_type |
-         | P        |
-        When searching for "54321"
-        Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 1 |
+         | ID | osm |
+         | 0  | R1 |
 
     # github #1763
     Scenario: Correct translation of highways under construction
index 42e62de57dc27955ab1fca4ddee1ca176c2c2c8f..7a0fa21a829667102a177e9abf3ad3671cd7c1a2 100644 (file)
@@ -10,7 +10,9 @@ Feature: Updates of linked places
             | osm | class    | type           | name | admin | geometry |
             | R1  | boundary | administrative | foo  | 8     | poly-area:0.1 |
         When importing
-        And searching for "foo" with dups
+        And sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | R |
@@ -20,7 +22,9 @@ Feature: Updates of linked places
         Then placex contains
          | object | linked_place_id |
          | N1     | - |
-        When searching for "foo" with dups
+        When sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | N |
@@ -33,7 +37,9 @@ Feature: Updates of linked places
             | osm | class    | type           | name | admin | geometry |
             | R1  | boundary | administrative | foo  | 8     | poly-area:0.1 |
         When importing
-        And searching for "foo" with dups
+        And sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | R |
@@ -41,7 +47,9 @@ Feature: Updates of linked places
         Then placex contains
          | object | linked_place_id |
          | N1     | - |
-        When searching for "foo" with dups
+        When sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | N |
@@ -51,7 +59,9 @@ Feature: Updates of linked places
             | osm | class | type | name | geometry |
             | N1  | place | city | foo  | 0 0 |
         When importing
-        And searching for "foo" with dups
+        And sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | N |
@@ -61,7 +71,9 @@ Feature: Updates of linked places
         Then placex contains
          | object | linked_place_id |
          | N1     | R1 |
-        When searching for "foo" with dups
+        When sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | R |
@@ -74,7 +86,9 @@ Feature: Updates of linked places
          | osm | class    | type           | name   | admin | geometry |
          | R1  | boundary | administrative | foobar | 8     | poly-area:0.1 |
         When importing
-        And searching for "foo" with dups
+        And sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | N |
@@ -84,7 +98,9 @@ Feature: Updates of linked places
         Then placex contains
          | object | linked_place_id |
          | N1     | R1 |
-        When searching for "foo" with dups
+        When sending search query "foo"
+         | dups |
+         | 1    |
         Then results contain
          | osm_type |
          | R |
index 4b5222fc61b086e36a404972b48e9b52ef7282c5..4023e3f9be29838ae2eced4f5c468968dc65f75a 100644 (file)
@@ -7,10 +7,10 @@ Feature: Update of names in place objects
           | osm | class    | type        | postcode | geometry |
           | R1  | boundary | postal_code | 12345    | poly-area:0.5 |
         When importing
-        And searching for "12345"
+        And sending search query "12345"
         Then results contain
-         | ID | osm_type | osm_id |
-         | 0  | R        | 1 |
+         | ID | osm |
+         | 0  | R1 |
         When updating places
           | osm | class    | type        | geometry |
           | R1  | boundary | postal_code | poly-area:0.5 |
index 247a397bd47b1ed7c7d5e886e4c95e1811759973..0920a7e2ff00b31b04ccd800e57ca6ed69c18138 100644 (file)
@@ -8,7 +8,9 @@ import xml.etree.ElementTree as ET
 
 from check_functions import Almost
 
-OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation'}
+OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation',
+            'n' : 'node', 'w' : 'way', 'r' : 'relation',
+            'node' : 'n', 'way' : 'w', 'relation' : 'r'}
 
 def _geojson_result_to_json_result(geojson_result):
     result = geojson_result['properties']
@@ -139,6 +141,9 @@ class GenericResponse:
                     assert self.result[i]['osm_type'] in (OSM_TYPE[value[0]], value[0]), \
                            BadRowValueAssert(self, i, 'osm_type', value)
                     self.assert_field(i, 'osm_id', value[1:])
+                elif name == 'osm_type':
+                    assert self.result[i]['osm_type'] in (OSM_TYPE[value[0]], value[0]), \
+                           BadRowValueAssert(self, i, 'osm_type', value)
                 elif name == 'centroid':
                     lon, lat = value.split(' ')
                     self.assert_field(i, 'lat', float(lat))
index 1b3da08b82f25913ad5721d3f7dec11f28d9574a..fc0a2156b5cd5e8dbc96de1e574879265c7d23ef 100644 (file)
@@ -55,29 +55,6 @@ def compare(operator, op1, op2):
         raise Exception("unknown operator '%s'" % operator)
 
 
-@when(u'searching for "(?P<query>.*)"(?P<dups> with dups)?')
-def query_cmd(context, query, dups):
-    """ Query directly via PHP script.
-    """
-    cmd = ['/usr/bin/env', 'php']
-    cmd.append(context.nominatim.src_dir  / 'lib-php' / 'admin' / 'query.php')
-    if query:
-        cmd.extend(['--search', query])
-    # add more parameters in table form
-    if context.table:
-        for h in context.table.headings:
-            value = context.table[0][h].strip()
-            if value:
-                cmd.extend(('--' + h, value))
-
-    if dups:
-        cmd.extend(('--dedupe', '0'))
-
-    outp, err = run_script(cmd, cwd=context.nominatim.website_dir.name,
-                           env=context.nominatim.test_env)
-
-    context.response = SearchResponse(outp, 'json')
-
 def send_api_query(endpoint, params, fmt, context):
     if fmt is not None and fmt.strip() != 'debug':
         params['format'] = fmt.strip()