sanic/tests/test_loop_policy.py

19 lines
445 B
Python
Raw Normal View History

2017-01-28 23:26:44 +00:00
from sanic import Sanic
from sanic.response import text
from sanic.utils import sanic_endpoint_test
import asyncio
import uvloop
def test_loop_policy():
app = Sanic('test_loop_policy')
@app.route('/')
def test(request):
return text("OK")
server = app.create_server()
request, response = sanic_endpoint_test(app)
assert isinstance(asyncio.get_event_loop_policy(),
uvloop.EventLoopPolicy)