]> git.openstreetmap.org Git - nominatim.git/commitdiff
update API tests
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 22 May 2015 19:49:31 +0000 (21:49 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 22 May 2015 19:49:31 +0000 (21:49 +0200)
tests/features/api/search.feature
tests/features/api/search_params.feature
tests/steps/api_result.py

index 859faa76f1256847d18e3eb703d6da8bbe026c02..c7ce7d3ba250a7318043726f483da7e8adb03118 100644 (file)
@@ -36,7 +36,7 @@ Feature: Search queries
         Then address of result 0 contains
           | type         | value
           | house_number | 140
-          | road         | rue Don Bosco
+          | road         | [Rr]ue Don Bosco
           | city         | Saguenay
           | state        | Quebec
           | country      | Canada
@@ -50,7 +50,7 @@ Feature: Search queries
         Then address of result 0 contains
           | type         | value
           | house_number | 141
-          | road         | rue Don Bosco
+          | road         | [rR]ue Don Bosco
           | city         | Saguenay
           | state        | Quebec
           | country      | Canada
index 1062cd0277c3702a015e3a8bc64fe4f532f6dcc1..b9d06791572eadd16e4720f63c19b7b5d812b3b0 100644 (file)
@@ -83,7 +83,7 @@ Feature: Search queries
     Scenario: bounded search remains within viewbox, even with no results
         Given the request parameters
          | bounded | viewbox
-         | 1       | -5.662003,43.54285,-5.6563282,43.5403125
+         | 1       | 43.54285,-5.662003,43.5403125,-5.6563282
          When sending json search query "restaurant"
         Then less than 1 result is returned
 
index 369127d861d6e0e1b79b777008a57a45fcca9982..e86641fc7ee3b8402d5765a38186f1e5ad867d73 100644 (file)
@@ -199,7 +199,10 @@ def api_result_address_exact(step, resid):
     addr = world.results[resid]['address']
     for line in step.hashes:
         assert_in(line['type'], addr)
-        assert_equals(line['value'], addr[line['type']])
+        m = re.match("%s$" % line['value'], addr[line['type']])
+        assert_is_not_none(m, msg="field %s does not match: %s$ != %s." % (
+                                  line['type'], line['value'], addr[line['type']]))
+        #assert_equals(line['value'], addr[line['type']])
 
 @step(u'address of result (\d+) does not contain (.*)')
 def api_result_address_details_missing(step, resid, types):