+ context.response = SearchResponse(outp, outfmt, status)
+
+@when(u'sending (?P<fmt>\S+ )?reverse coordinates (?P<lat>[0-9.-]+)?,(?P<lon>[0-9.-]+)?')
+def website_reverse_request(context, fmt, lat, lon):
+ params = {}
+ if lat is not None:
+ params['lat'] = lat
+ if lon is not None:
+ params['lon'] = lon
+
+ outp, status = send_api_query('reverse', params, fmt, context)
+
+ if fmt is None:
+ outfmt = 'xml'
+ elif fmt == 'jsonv2 ':
+ outfmt = 'json'
+ else:
+ outfmt = fmt.strip()
+
+ context.response = ReverseResponse(outp, outfmt, status)
+
+@when(u'sending (?P<fmt>\S+ )?details query for (?P<query>.*)')
+def website_details_request(context, fmt, query):
+ params = {}
+ if query[0] in 'NWR':
+ params['osmtype'] = query[0]
+ params['osmid'] = query[1:]
+ else:
+ params['place_id'] = query
+ outp, status = send_api_query('details', params, fmt, context)
+
+ context.response = DetailsResponse(outp, 'html', status)
+
+@when(u'sending (?P<fmt>\S+ )?lookup query for (?P<query>.*)')
+def website_lookup_request(context, fmt, query):
+ params = { 'osm_ids' : query }
+ outp, status = send_api_query('lookup', params, fmt, context)
+
+ if fmt == 'json ':
+ outfmt = 'json'
+ else:
+ outfmt = 'xml'
+
+ context.response = SearchResponse(outp, outfmt, status)