]> git.openstreetmap.org Git - nominatim.git/commitdiff
add regression test
authorMarc Tobias Metten <mtmail@gmx.net>
Tue, 28 Oct 2014 14:40:01 +0000 (15:40 +0100)
committerMarc Tobias Metten <mtmail@gmx.net>
Tue, 28 Oct 2014 14:40:01 +0000 (15:40 +0100)
tests/features/api/regression.feature
tests/steps/api_setup.py

index f1887e1a045615063edf5e67b3bd6fcca376b5c1..fcc11dd2abc9e5ed9b0a3ff3c899e2b5da6e6578 100644 (file)
@@ -184,3 +184,10 @@ Feature: API regression tests
          | 1       | 0,0,-1,-1
         When sending json search query "sy"
         Then exactly 0 results are returned
+
+    Scenario: github #190
+        When looking up place N257363453
+        Then the results contain
+         | osm_type   | osm_id     | latlon
+         | node       | 257363453  | 35.8404121,128.5586643 +-100m
+
index 9accf4206ccea4a2cb57d17663237834ebc378e2..dc39a3bc9069d4e071bc8991ef8896cfbc48475b 100644 (file)
@@ -103,6 +103,16 @@ def api_setup_reverse(step, fmt, lat, lon):
         world.params['format'] = fmt.strip()
     api_call('reverse')
 
+@step(u'looking up place ([NRW]?\d+)')
+def api_setup_details(step, obj):
+    if obj[0] in ('N', 'R', 'W'):
+        # an osm id
+        world.params['osm_type']  = obj[0]
+        world.params['osm_id'] = obj[1:]
+    else:
+        world.params['place_id']  = obj
+    api_call('reverse')
+
 @step(u'looking up details for ([NRW]?\d+)')
 def api_setup_details(step, obj):
     if obj[0] in ('N', 'R', 'W'):