mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
This commit is contained in:
commit
cac05e2e90
4 changed files with 8 additions and 1 deletions
|
@ -164,6 +164,9 @@ class BasicTest(TestCase):
|
|||
sock = FakeSocket(body)
|
||||
resp = client.HTTPResponse(sock)
|
||||
resp.begin()
|
||||
self.assertEqual(resp.read(0), b'') # Issue #20007
|
||||
self.assertFalse(resp.isclosed())
|
||||
self.assertFalse(resp.closed)
|
||||
self.assertEqual(resp.read(), b"Text")
|
||||
self.assertTrue(resp.isclosed())
|
||||
self.assertFalse(resp.closed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue