From cf439f01f8370971799182abc0e0c635037d2b2f Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Wed, 7 Nov 2018 21:29:12 +0100 Subject: [PATCH] Add test for has_message_body helper function. --- tests/test_helpers.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_helpers.py diff --git a/tests/test_helpers.py b/tests/test_helpers.py new file mode 100644 index 00000000..cf859b96 --- /dev/null +++ b/tests/test_helpers.py @@ -0,0 +1,14 @@ +from sanic.helpers import has_message_body + + +def test_has_message_body(): + tests = ( + (100, False), + (102, False), + (204, False), + (200, True), + (304, False), + (400, True), + ) + for status_code, expected in tests: + assert has_message_body(status_code) is expected