Updated test terminology
This commit is contained in:
parent
993627ec44
commit
922c96e3c1
|
@ -9,16 +9,16 @@ def test_storage():
|
||||||
|
|
||||||
@app.middleware('request')
|
@app.middleware('request')
|
||||||
def store(request):
|
def store(request):
|
||||||
request['a'] = 'test'
|
request['user'] = 'sanic'
|
||||||
request['b'] = 'zest'
|
request['sidekick'] = 'tails'
|
||||||
del request['b']
|
del request['sidekick']
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def handler(request):
|
def handler(request):
|
||||||
return json({ 'a': request.get('a'), 'b': request.get('b') })
|
return json({ 'user': request.get('user'), 'sidekick': request.get('sidekick') })
|
||||||
|
|
||||||
request, response = sanic_endpoint_test(app)
|
request, response = sanic_endpoint_test(app)
|
||||||
|
|
||||||
response_json = loads(response.text)
|
response_json = loads(response.text)
|
||||||
assert response_json['a'] == 'test'
|
assert response_json['user'] == 'sanic'
|
||||||
assert response_json.get('b') is None
|
assert response_json.get('sidekick') is None
|
Loading…
Reference in New Issue
Block a user