Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 8d64797

Browse files
author
ex3me0
authored
Added test-case "response with empty reason"
1 parent ba65163 commit 8d64797

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_http11.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,23 @@ def test_chunked_overrides_body(self):
328328
received = b''.join(sock.queue)
329329

330330
assert received == expected
331+
332+
def test_response_with_empty_reason(self):
333+
c = HTTP11Connection('httpbin.org')
334+
c._sock = sock = DummySocket()
335+
336+
sock._buffer = BytesIO(
337+
b"HTTP/1.1 201\r\n"
338+
b"Connection: close\r\n"
339+
b"Server: Socket\r\n"
340+
b"Content-Length: 0\r\n"
341+
b"\r\n"
342+
)
343+
344+
r = c.get_response()
345+
346+
assert r.status == 201
347+
assert r.reason == b''
331348

332349
def test_get_response(self):
333350
c = HTTP11Connection('httpbin.org')

0 commit comments

Comments
 (0)