]> git.openstreetmap.org Git - nominatim.git/commitdiff
tests: more coverage for all API endpoints
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Oct 2017 22:05:34 +0000 (00:05 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Oct 2017 22:05:34 +0000 (00:05 +0200)
lib/PlaceLookup.php
test/bdd/api/details/simple.feature
test/bdd/api/reverse/queries.feature
test/bdd/api/search/queries.feature

index 40d003fa7c593fc81e3aee0c62c258f8613850c4..4920a1318d6edd24bbb84c5ae1dab83ef4c3bbcf 100644 (file)
@@ -45,27 +45,16 @@ class PlaceLookup
         $this->bNameDetails = $bNameDetails;
     }
 
-
     public function setIncludePolygonAsPoints($b = true)
     {
         $this->bIncludePolygonAsPoints = $b;
     }
 
-    public function getIncludePolygonAsPoints()
-    {
-        return $this->bIncludePolygonAsPoints;
-    }
-
     public function setIncludePolygonAsText($b = true)
     {
         $this->bIncludePolygonAsText = $b;
     }
 
-    public function getIncludePolygonAsText()
-    {
-        return $this->bIncludePolygonAsText;
-    }
-
     public function setIncludePolygonAsGeoJSON($b = true)
     {
         $this->bIncludePolygonAsGeoJSON = $b;
index 638e89ca9bfe8e1fafc3e2d616598533df3a8204..8971c5c2d0f36a21db13b6cdf776f2ba64ae47a1 100644 (file)
@@ -12,3 +12,9 @@ Feature: Object details
      | N4267356889 |
      | W230804120 |
      | R123924 |
+
+    Scenario: Details with keywords
+        When sending details query for W78099902
+            | keywords |
+            | 1 |
+        Then the result is valid html
index e1d089b92c13279f6f9736f7038e1afb566e64d6..b860823e596d3dea7bd7795a7186c5f056606cdc 100644 (file)
@@ -23,3 +23,12 @@ Feature: Reverse geocoding
         And result addresses contain
           | road            | postcode | country_code |
           | West 1st Street | 57274    | us |
+
+    Scenario: Interpolated house number
+        When sending jsonv2 reverse coordinates -33.231795578514635,-54.38682173844428
+        Then results contain
+          | osm_type | category | type |
+          | way      | place    | house |
+        And result addresses contain
+          | house_number | road |
+          | 1410         | Juan Antonio Lavalleja |
index 2767f87cfd40fc84bb74005983be0fbd066b6d2a..5ef8f7ed8bbf9139f4edfef88238089734fb5f87 100644 (file)
@@ -44,6 +44,17 @@ Feature: Search queries
           | country      | Deutschland |
           | country_code | de |
 
+    Scenario: With missing housenumber search falls back to road
+        When sending json search query "342 rocha, santa lucia" with address
+        Then address of result 0 is
+          | type         | value |
+          | road         | Rocha |
+          | city         | Santa Lucía |
+          | state        | Canelones |
+          | postcode     | 90700 |
+          | country      | Uruguay |
+          | country_code | uy |
+
     @Tiger
     Scenario: TIGER house number
         When sending json search query "323 22nd Street Southwest, Huron"
@@ -91,11 +102,25 @@ Feature: Search queries
           | amenity | restaurant |
 
     Scenario: Arbitrary key/value search near given coordinate
-        When sending json search query "[man_made=mast]  47.15739,9.61264"
+        When sending json search query "[man_made=mast]  47.15739° N 9.61264° E"
+        Then results contain
+          | class    | type |
+          | man_made | mast |
+
+    Scenario: Arbitrary key/value search near given coordinate and named place
+        When sending json search query "[man_made=mast] amerlugalpe  47° 9′ 26″ N 9° 36′ 45″ E"
         Then results contain
           | class    | type |
           | man_made | mast |
 
+    Scenario: Name search near given coordinate
+        When sending json search query "amerlugalpe, N 47.15739° E 9.61264°"
+        Then exactly 1 result is returned
+
+    Scenario: Name search near given coordinate without result
+        When sending json search query "amerlugalpe, N 47 15 7 W 9 61 26"
+        Then exactly 0 results are returned
+
     Scenario: Arbitrary key/value search near a road
         When sending json search query "[leisure=table_soccer_table] immenbusch"
         Then results contain