added one more test

This commit is contained in:
Arnulfo Solis 2018-02-01 20:00:32 +01:00
parent 68fd1b66b5
commit 4b6e89a526

View File

@ -63,8 +63,12 @@ def json_app():
async def test(request):
return json(JSON_DATA)
@app.get("/no-content")
async def no_content_handler(request):
return json(JSON_DATA, status=204)
@app.delete("/")
async def test_delete(request):
async def delete_handler(request):
return json(None, status=204)
return app
@ -79,6 +83,11 @@ def test_json_response(json_app):
def test_no_content(json_app):
request, response = json_app.test_client.get('/no-content')
assert response.status == 204
assert response.text == ''
assert response.headers['Content-Length'] == '0'
request, response = json_app.test_client.delete('/')
assert response.status == 204
assert response.text == ''