added one more test
This commit is contained in:
parent
68fd1b66b5
commit
4b6e89a526
@ -63,8 +63,12 @@ def json_app():
|
|||||||
async def test(request):
|
async def test(request):
|
||||||
return json(JSON_DATA)
|
return json(JSON_DATA)
|
||||||
|
|
||||||
|
@app.get("/no-content")
|
||||||
|
async def no_content_handler(request):
|
||||||
|
return json(JSON_DATA, status=204)
|
||||||
|
|
||||||
@app.delete("/")
|
@app.delete("/")
|
||||||
async def test_delete(request):
|
async def delete_handler(request):
|
||||||
return json(None, status=204)
|
return json(None, status=204)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
@ -79,6 +83,11 @@ def test_json_response(json_app):
|
|||||||
|
|
||||||
|
|
||||||
def test_no_content(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('/')
|
request, response = json_app.test_client.delete('/')
|
||||||
assert response.status == 204
|
assert response.status == 204
|
||||||
assert response.text == ''
|
assert response.text == ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user