Merge pull request #1405 from hramezani/test_has_message_body

Add test for has_message_body helper function.
This commit is contained in:
7 2018-11-08 22:20:07 +08:00 committed by GitHub
commit 0e9f350982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
tests/test_helpers.py Normal file
View File

@ -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