From 1c84ac1f5528d26cb226210c2843b765efae83a4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 17 Dec 2013 21:50:02 +0200 Subject: Issue #20007: HTTPResponse.read(0) no more prematurely closes connection. Original patch by Simon Sapin. --- Lib/test/test_httplib.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/test') diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index f3c27c2df6..4410a93f4f 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -162,6 +162,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) -- cgit v1.2.1