Skip to content

Commit 2cd0ead

Browse files
committed
Improved test
1 parent f082c53 commit 2cd0ead

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Lib/test/test_httplib.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,17 @@ def test_chunked(self):
10811081
self.assertEqual(resp.read(), expected)
10821082
resp.close()
10831083

1084+
# explicit full read
1085+
for n in (-1, None):
1086+
with self.subTest('full read', n=n):
1087+
sock = FakeSocket(chunked_start + last_chunk + chunked_end)
1088+
resp = client.HTTPResponse(sock, method="GET")
1089+
resp.begin()
1090+
self.assertEqual(resp.read(n), expected)
1091+
resp.close()
1092+
10841093
# Various read sizes
1085-
for n in list(range(1, 12)) + [-1, None]:
1094+
for n in range(1, 12):
10861095
sock = FakeSocket(chunked_start + last_chunk + chunked_end)
10871096
resp = client.HTTPResponse(sock, method="GET")
10881097
resp.begin()

0 commit comments

Comments
 (0)