X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/88374c2522fd30967ce1e0460cb696d68a817f67..e5b74245922339f0bf9c0c36a67a261a13af3fa1:/test/bdd/steps/queries.py diff --git a/test/bdd/steps/queries.py b/test/bdd/steps/queries.py index df34b5cc..4d59b923 100644 --- a/test/bdd/steps/queries.py +++ b/test/bdd/steps/queries.py @@ -494,6 +494,18 @@ def step_impl(context, fmt): context.execute_steps("Then a HTTP 200 is returned") eq_(context.response.format, fmt) +@then(u'a (?P\w+) user error is returned') +def check_page_error(context, fmt): + context.execute_steps("Then a HTTP 400 is returned") + eq_(context.response.format, fmt) + + if fmt == 'html': + assert_is_not_none(re.search(r').+', context.response.page, re.DOTALL)) + elif fmt == 'xml': + assert_is_not_none(re.search(r'.+', context.response.page, re.DOTALL)) + else: + assert_is_not_none(re.search(r'({"error":)', context.response.page, re.DOTALL)) + @then(u'result header contains') def check_header_attr(context): for line in context.table: