world.response_format = fmt
elif fmt in ('json', 'jsonv2'):
if 'json_callback' in world.params:
- world.json_callback = world.params['json_callback']
+ world.json_callback = world.params['json_callback'].encode('utf8')
assert world.page.startswith(world.json_callback + '(')
assert world.page.endswith(')')
world.page = world.page[(len(world.json_callback)+1):-1]
api_call('reverse')
@step(u'looking up place ([NRW]?\d+)')
-def api_setup_details(step, obj):
+def api_setup_details_reverse(step, obj):
if obj[0] in ('N', 'R', 'W'):
# an osm id
world.params['osm_type'] = obj[0]
else:
world.params['place_id'] = obj
api_call('details')
+
+@step(u'sending an API call (\w+)')
+def api_general_call(step, call):
+ api_call(call)