fix(bench): Incorrect request path

Also updated werkzeug test to query account_id value.
This commit is contained in:
kgriffs
2013-03-27 03:21:16 -05:00
parent 3eef795b1b
commit 8e541fdb1d
2 changed files with 11 additions and 9 deletions

View File

@@ -38,12 +38,12 @@ def create_bench(name):
srmock = helpers.StartResponseMock()
request_headers = {'Content-Type': 'application/json'}
# env = helpers.create_environ('/hello/584/test', query_string='limit=10',
# headers=request_headers)
env = helpers.create_environ('/hello', query_string='limit=10',
env = helpers.create_environ('/hello/584/test', query_string='limit=10',
headers=request_headers)
# env = helpers.create_environ('/hello', query_string='limit=10',
# headers=request_headers)
body = helpers.rand_string(0, 10240) # NOQA
headers = {'X-Test': 'Funky Chicken'} # NOQA

View File

@@ -1,6 +1,6 @@
import sys
import re
import six
# import six
def create_falcon(body, headers):
@@ -19,10 +19,11 @@ def create_falcon(body, headers):
def on_get(self, req, resp, account_id):
user_agent = req.user_agent # NOQA
limit = req.get_param('limit', '10') # NOQA
if six.PY3:
resp.body = body
else:
resp.data = body
resp.data = body
# if six.PY3:
# resp.body = body
# else:
# resp.data = body
# resp.vary = ['accept-encoding', 'x-auth-token']
#resp.content_range = (0, 499, 10240)
@@ -120,6 +121,7 @@ def create_werkzeug(body, headers):
limit = request.args.get('limit', '10') # NOQA
adapter = url_map.bind_to_environ(request.environ) # NOQA
endpoint, values = adapter.match() # NOQA
aid = values['account_id'] # NOQA
return werkzeug.Response(body, headers=headers,
mimetype='text/plain')