From 74f05108d7f09d52ac4c60330e12978f6943fe96 Mon Sep 17 00:00:00 2001 From: Sergey Fedoruk Date: Sun, 30 Dec 2018 22:14:10 +0100 Subject: [PATCH] async test for access_log in create_server --- tests/test_config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 1ace7579..fe4b97b9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -224,6 +224,20 @@ def test_config_access_log_passing_in_run(app): assert app.config.ACCESS_LOG == True +async def test_config_access_log_passing_in_create_server(app): + assert app.config.ACCESS_LOG == True + + @app.listener('after_server_start') + async def _request(sanic, loop): + app.stop() + + await app.create_server(port=1341, access_log=False) + assert app.config.ACCESS_LOG == False + + await app.create_server(port=1342, access_log=True) + assert app.config.ACCESS_LOG == True + + def test_config_rewrite_keep_alive(): config = Config() assert config.KEEP_ALIVE == DEFAULT_CONFIG["KEEP_ALIVE"]