rework testing

This commit is contained in:
Suby Raman
2017-02-14 14:51:20 -05:00
parent 51611c3934
commit 3b68dc72e7
27 changed files with 387 additions and 342 deletions

View File

@@ -2,7 +2,6 @@ from random import choice
from sanic import Sanic
from sanic.response import HTTPResponse
from sanic.utils import sanic_endpoint_test
def test_response_body_not_a_string():
@@ -14,5 +13,5 @@ def test_response_body_not_a_string():
async def hello_route(request):
return HTTPResponse(body=random_num)
request, response = sanic_endpoint_test(app, uri='/hello')
request, response = app.test_client.get('/hello')
assert response.text == str(random_num)