From f5aaf6f025577d2381d432e8bd3dc33671112078 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sun, 29 Apr 2012 10:15:31 +0800 Subject: [PATCH] httplib test for early eof response. related to Issue13684 --- Lib/test/test_httplib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 38c0d2db0e..05df87513a 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -349,6 +349,14 @@ class BasicTest(TestCase): resp.begin() self.assertRaises(httplib.LineTooLong, resp.read) + def test_early_eof(self): + # Test httpresponse with no \r\n termination, + body = "HTTP/1.1 200 Ok" + sock = FakeSocket(body) + resp = httplib.HTTPResponse(sock) + resp.begin() + self.assertEqual(resp.read(), '') + self.assertTrue(resp.isclosed()) class OfflineTest(TestCase): def test_responses(self): -- 2.40.0