fix(bench): Incorrect request path
Also updated werkzeug test to query account_id value.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user